stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus data/ccl/stratagus.ccl doc/ccl/config...


From: Crestez Leonard
Subject: [Stratagus-CVS] stratagus data/ccl/stratagus.ccl doc/ccl/config...
Date: Sat, 25 Oct 2003 19:10:44 -0400

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Crestez Leonard <address@hidden>        03/10/25 19:10:44

Modified files:
        data/ccl       : stratagus.ccl 
        doc/ccl        : config.html magic.html 
        src/action     : actions.c 
        src/clone      : unit.c 
        src/include    : missile.h unit.h 
        src/missile    : ccl_missile.c missile.c 
        src/unit       : ccl_unit.c 

Log message:
        Fix flame shield. Removed global set-hit-point-regeneration.

Patches:
Index: stratagus/data/ccl/stratagus.ccl
diff -u stratagus/data/ccl/stratagus.ccl:1.22 
stratagus/data/ccl/stratagus.ccl:1.23
--- stratagus/data/ccl/stratagus.ccl:1.22       Tue Oct 21 18:31:31 2003
+++ stratagus/data/ccl/stratagus.ccl    Sat Oct 25 19:10:43 2003
@@ -26,7 +26,7 @@
 ;;      along with this program; if not, write to the Free Software
 ;;      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA
 ;;
-;;     $Id: stratagus.ccl,v 1.22 2003/10/21 22:31:31 jsalmon3 Exp $
+;;     $Id: stratagus.ccl,v 1.23 2003/10/25 23:10:43 n0body Exp $
 
 ;; For documentation see stratagus/doc/ccl/ccl.html
 
@@ -199,10 +199,6 @@
 
 ;;-----------------------------------------------------------------------------
 ;;     Game modification
-
-;;     Edit this to enable/disable hit point regeneration for all units
-;(set-hitpoint-regeneration! #t)
-(set-hitpoint-regeneration! #f)
 
 ;;     Edit this to enable/disable XP to add more damage to attacks
 ;(set-xp-damage! #t)
Index: stratagus/doc/ccl/config.html
diff -u stratagus/doc/ccl/config.html:1.30 stratagus/doc/ccl/config.html:1.31
--- stratagus/doc/ccl/config.html:1.30  Thu Oct 16 13:03:00 2003
+++ stratagus/doc/ccl/config.html       Sat Oct 25 19:10:43 2003
@@ -77,7 +77,6 @@
 <a href="#set-forest-regeneration!">set-forest-regeneration!</a>
 <a href="#set-goldmine-depleted!">set-goldmine-depleted!</a>
 <a href="#set-grab-mouse!">set-grab-mouse!</a>
-<a href="#set-hitpoint-regeneration!">set-hitpoint-regeneration!</a>
 <a href="#set-hold-click-delay!">set-hold-click-delay!</a>
 <a href="#set-key-scroll!">set-key-scroll!</a>
 <a href="#set-key-scroll-speed!">set-key-scroll-speed!</a>
@@ -769,27 +768,6 @@
 
 <a href="../../data/ccl/stratagus.ccl"> $LIBARYPATH/ccl/stratagus.ccl </a>
 
-<a name="set-hitpoint-regeneration!"></a>
-<h3>(set-hitpoint-regeneration! regen)</h3>
-
-.
-
-
-<dl>
-<dt>regen</dt>
-<dd>.
-</dd>
-</dl>
-
-<h4>Example</h4>
-
-<pre>
-    (set-hitpoint-regeneration! #f)
-</pre>
-<h4>Used</h4>
-
-<a href="../../data/ccl/stratagus.ccl"> $LIBARYPATH/ccl/stratagus.ccl </a>
-
 <a name="set-hold-click-delay!"></a>
 <h3>(set-hold-click-delay! delay)</h3>
 
@@ -1576,7 +1554,7 @@
 <a href="../../data/ccl/stratagus.ccl"> $LIBARYPATH/ccl/stratagus.ccl </a>
 
 <hr>
-Last changed: $Id: config.html,v 1.30 2003/10/16 17:03:00 jsalmon3 Exp $<br>
+Last changed: $Id: config.html,v 1.31 2003/10/25 23:10:43 n0body Exp $<br>
 All trademarks and copyrights on this page are owned by their respective 
owners.
 <address>(c) 2002-2003 by <a href="http://stratagus.org";>
 The Stratagus Project</a></address></body></html>
Index: stratagus/doc/ccl/magic.html
diff -u stratagus/doc/ccl/magic.html:1.5 stratagus/doc/ccl/magic.html:1.6
--- stratagus/doc/ccl/magic.html:1.5    Thu Oct 23 21:58:32 2003
+++ stratagus/doc/ccl/magic.html        Sat Oct 25 19:10:43 2003
@@ -471,6 +471,10 @@
 the missile is automatically removed from the map. If -1 the
 missile lives for ever and the lifetime is handled by other means.
 </dd>
+<dt>hidden</dt>
+<dd>This marks the unit as hidden, until the unit is shown again in the
+controlling function. No parameters.
+</dd>
 </dl>
 
 <h4>Example</h4>
@@ -486,7 +490,7 @@
 
 
 <hr>
-Last changed: $Id: magic.html,v 1.5 2003/10/24 01:58:32 n0body Exp $<br>
+Last changed: $Id: magic.html,v 1.6 2003/10/25 23:10:43 n0body Exp $<br>
 All trademarks and copyrights on this page are owned by their respective 
owners.
 <address>(c) 2002-2003 by <a href="http://stratagus.org";>
 The Stratagus Project</a></address></body></html>
Index: stratagus/src/action/actions.c
diff -u stratagus/src/action/actions.c:1.101 
stratagus/src/action/actions.c:1.102
--- stratagus/src/action/actions.c:1.101        Sat Oct 25 14:58:42 2003
+++ stratagus/src/action/actions.c      Sat Oct 25 19:10:44 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: actions.c,v 1.101 2003/10/25 18:58:42 n0body Exp $
+//     $Id: actions.c,v 1.102 2003/10/25 23:10:44 n0body Exp $
 
 //@{
 
@@ -270,14 +270,6 @@
 {
     // Unit may not have stats assigned to it
     if (unit->Stats) {
-       if (HitPointRegeneration && unit->HP<unit->Stats->HitPoints) {
-           ++unit->HP;
-
-           if (unit->Selected) {
-               MustRedraw |= RedrawInfoPanel;
-           }
-       }
-       
        if (unit->Stats->RegenerationRate && unit->HP<unit->Stats->HitPoints) {
            unit->HP += unit->Stats->RegenerationRate;
            if (unit->HP > unit->Stats->HitPoints) {
Index: stratagus/src/clone/unit.c
diff -u stratagus/src/clone/unit.c:1.316 stratagus/src/clone/unit.c:1.317
--- stratagus/src/clone/unit.c:1.316    Sat Oct 25 14:58:42 2003
+++ stratagus/src/clone/unit.c  Sat Oct 25 19:10:44 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unit.c,v 1.316 2003/10/25 18:58:42 n0body Exp $
+//     $Id: unit.c,v 1.317 2003/10/25 23:10:44 n0body Exp $
 
 //@{
 
@@ -79,7 +79,6 @@
 global Unit* DestroyedBuildings;       /// List of DestroyedBuildings
 global Unit* CorpseList;               /// List of Corpses On Map
 
-global int HitPointRegeneration;       /// Hit point regeneration for all units
 global int XpDamage;                   /// Hit point regeneration for all units
 global char EnableTrainingQueue;       /// Config: training queues enabled
 global char EnableBuildingCapture;     /// Config: capture buildings enabled
@@ -3739,13 +3738,11 @@
     int RunStart;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.316 2003/10/25 18:58:42 
n0body Exp $\n\n");
+    CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.317 2003/10/25 23:10:44 
n0body Exp $\n\n");
 
     //
     // Local variables
     //
-    CLprintf(file, "(set-hitpoint-regeneration! #%s)\n",
-       HitPointRegeneration ? "t" : "f");
     CLprintf(file, "(set-xp-damage! #%s)\n",
        XpDamage ? "t" : "f");
     CLprintf(file, "(set-fancy-buildings! #%s)\n",
@@ -3836,7 +3833,6 @@
 
     InitUnitsMemory();
 
-    HitPointRegeneration = 0;
     XpDamage = 0;
     FancyBuildings = 0;
 }
Index: stratagus/src/include/missile.h
diff -u stratagus/src/include/missile.h:1.70 
stratagus/src/include/missile.h:1.71
--- stratagus/src/include/missile.h:1.70        Mon Oct 20 20:18:31 2003
+++ stratagus/src/include/missile.h     Sat Oct 25 19:10:44 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: missile.h,v 1.70 2003/10/21 00:18:31 n0body Exp $
+//     $Id: missile.h,v 1.71 2003/10/25 23:10:44 n0body Exp $
 
 #ifndef __MISSILE_H__
 #define __MISSILE_H__
@@ -294,6 +294,10 @@
 **             missile lives for ever and the lifetime is handled by
 **             Missile::Type:MissileType::Class
 **
+**     Missile::Hidden
+**
+**             When you set this to 1 the unit becomes hidden for a while.
+**
 **     Missile::CurrentStep
 **
 **             Movement step. Used for the different trajectories.
@@ -450,6 +454,7 @@
     int                Damage;                 /// direct damage that missile 
applies
 
     int                TTL;                    /// time to live (ticks) used 
for spells
+    int        Hidden;                 /// If this is 1 then the missile is 
invisible
 
 // Internal use:
     int                CurrentStep;            /// Current step (0 <= x < 
TotalStep).
Index: stratagus/src/include/unit.h
diff -u stratagus/src/include/unit.h:1.223 stratagus/src/include/unit.h:1.224
--- stratagus/src/include/unit.h:1.223  Thu Oct 23 21:58:33 2003
+++ stratagus/src/include/unit.h        Sat Oct 25 19:10:44 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unit.h,v 1.223 2003/10/24 01:58:33 n0body Exp $
+//     $Id: unit.h,v 1.224 2003/10/25 23:10:44 n0body Exp $
 
 #ifndef __UNIT_H__
 #define __UNIT_H__
@@ -720,7 +720,6 @@
 extern int ShowAttackRange;            /// Flag: show attack range
 extern int ShowOrders;                 /// Flag: show orders of unit on map
 extern unsigned long ShowOrdersCount;  /// Show orders for some time
-extern int HitPointRegeneration;       /// Hit point regeneration for all units
 extern int XpDamage;                   /// unit XP adds more damage to attacks
 extern char EnableTrainingQueue;       /// Config: training queues enabled
 extern char EnableBuildingCapture;     /// Config: building capture enabled
Index: stratagus/src/missile/ccl_missile.c
diff -u stratagus/src/missile/ccl_missile.c:1.36 
stratagus/src/missile/ccl_missile.c:1.37
--- stratagus/src/missile/ccl_missile.c:1.36    Fri Oct 24 23:12:16 2003
+++ stratagus/src/missile/ccl_missile.c Sat Oct 25 19:10:44 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl_missile.c,v 1.36 2003/10/25 03:12:16 n0body Exp $
+//     $Id: ccl_missile.c,v 1.37 2003/10/25 23:10:44 n0body Exp $
 
 //@{
 
@@ -310,6 +310,10 @@
        } else if (gh_eq_p(value, gh_symbol2scm("ttl"))) {
            DebugCheck(!missile);
            missile->TTL = gh_scm2int(gh_car(list));
+           list = gh_cdr(list);
+       } else if (gh_eq_p(value, gh_symbol2scm("hidden"))) {
+           DebugCheck(!missile);
+           missile->Hidden = 1;
            list = gh_cdr(list);
        } else if (gh_eq_p(value, gh_symbol2scm("step"))) {
            SCM sublist;
Index: stratagus/src/missile/missile.c
diff -u stratagus/src/missile/missile.c:1.103 
stratagus/src/missile/missile.c:1.104
--- stratagus/src/missile/missile.c:1.103       Sat Oct 25 14:58:43 2003
+++ stratagus/src/missile/missile.c     Sat Oct 25 19:10:44 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: missile.c,v 1.103 2003/10/25 18:58:43 n0body Exp $
+//     $Id: missile.c,v 1.104 2003/10/25 23:10:44 n0body Exp $
 
 //@{
 
@@ -315,6 +315,7 @@
     missile->SourceUnit = NULL;
 
     missile->Damage = 0;
+    missile->Hidden = 0;
     missile->TargetUnit = NULL;
     missile->TTL = -1;
 
@@ -758,8 +759,8 @@
     do {
        for (; missiles < missiles_end; ++missiles) {
            missile = *missiles;
-           if (missile->Delay) {
-               continue;       // delayed aren't shown
+           if (missile->Delay || missile->Hidden) {
+               continue;       // delayed or hidden -> aren't shown
            }
            // Draw only visible missiles
            if (!flag || MissileVisibleInViewport(vp, missile)) {
@@ -1345,7 +1346,7 @@
 
     DebugCheck(file == NULL);
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: missile-types $Id: missile.c,v 1.103 
2003/10/25 18:58:43 n0body Exp $\n\n");
+    CLprintf(file, ";;; MODULE: missile-types $Id: missile.c,v 1.104 
2003/10/25 23:10:44 n0body Exp $\n\n");
 
     //
     // Original number to internal missile-type name.
@@ -1434,6 +1435,9 @@
     }
     CLprintf(file, " 'damage %d", missile->Damage);
     CLprintf(file, " 'ttl %d", missile->TTL);
+    if (missile->Hidden) {
+       CLprintf(file, " 'hidden ");
+    }
     CLprintf(file, " 'step '(%d %d)",
        missile->CurrentStep,
        missile->TotalStep);
@@ -1451,7 +1455,7 @@
 
     DebugCheck(file == NULL);
     CLprintf(file,"\n;;; -----------------------------------------\n");
-    CLprintf(file,";;; MODULE: missiles $Id: missile.c,v 1.103 2003/10/25 
18:58:43 n0body Exp $\n\n");
+    CLprintf(file,";;; MODULE: missiles $Id: missile.c,v 1.104 2003/10/25 
23:10:44 n0body Exp $\n\n");
 
     for (missiles = GlobalMissiles; *missiles; ++missiles) {
        SaveMissile(*missiles, file);
@@ -1787,6 +1791,7 @@
        -27, -15, -30, -10, -31, -5, -32, 0, -31, 5, -30, 10, -27, 16, -24,
        20, -20, 24, -15, 27, -10, 30, -5, 31, 0, 32};
     Unit *table[UnitMax];
+    Unit *unit;
     int n;
     int i;
     int dx;
@@ -1803,22 +1808,35 @@
     i = missile->TTL % 36;             // 36 positions on the circle
     dx = fs_dc[i * 2];
     dy = fs_dc[i * 2 + 1];
-    ux = missile->TargetUnit->X;
-    uy = missile->TargetUnit->Y;
-    ix = missile->TargetUnit->IX;
-    iy = missile->TargetUnit->IY;
-    uw = missile->TargetUnit->Type->Width;
-    uh = missile->TargetUnit->Type->Height;
-    missile->X = ux * TileSizeX + ix + uw / 2 + dx - 32;
-    missile->Y = uy * TileSizeY + iy + uh / 2 + dy - 32 - 16;
-    if (missile->TargetUnit->Orders[0].Action == UnitActionDie) {
+    unit = missile->TargetUnit;
+    //
+    // Show around the top most unit.
+    // FIXME: conf, do we hide if the unit is contained or not?
+    //
+    while (unit->Container) {
+       unit=unit->Container;
+    }
+    ux = unit->X;
+    uy = unit->Y;
+    ix = unit->IX;
+    iy = unit->IY;
+    uw = unit->Type->TileWidth;
+    uh = unit->Type->TileHeight;
+    missile->X = ux * TileSizeX + ix + uw * TileSizeX / 2 + dx - 16;
+    missile->Y = uy * TileSizeY + iy + uh * TileSizeY / 2 + dy - 32;
+    if (unit->Orders[0].Action == UnitActionDie) {
        missile->TTL = i;
     }
     if (missile->TTL == 0) {
-       missile->TargetUnit->FlameShield = 0;
+       unit->FlameShield = 0;
+    }
+
+    if (unit->Container) {
+       missile->Hidden = 1;
+       return;         /// Hidden missile don't do damage.
+    } else {
+       missile->Hidden = 0;
     }
-    //vladi: still no have clear idea what is this about :)
-    CheckMissileToBeDrawn(missile);
 
     // Only hit 1 out of 8 frames
     if (missile->TTL & 7) {
@@ -1826,7 +1844,7 @@
     }
     n = SelectUnits(ux - 1, uy - 1, ux + 1 + 1, uy + 1 + 1, table);
     for (i = 0; i < n; ++i) {
-       if (table[i] == missile->TargetUnit) {
+       if (table[i] == unit) {
            // cannot hit target unit
            continue;
        }
Index: stratagus/src/unit/ccl_unit.c
diff -u stratagus/src/unit/ccl_unit.c:1.70 stratagus/src/unit/ccl_unit.c:1.71
--- stratagus/src/unit/ccl_unit.c:1.70  Thu Oct 23 21:58:34 2003
+++ stratagus/src/unit/ccl_unit.c       Sat Oct 25 19:10:44 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl_unit.c,v 1.70 2003/10/24 01:58:34 n0body Exp $
+//     $Id: ccl_unit.c,v 1.71 2003/10/25 23:10:44 n0body Exp $
 
 //@{
 
@@ -62,23 +62,6 @@
 extern unsigned CclGetResourceByName(SCM ptr);
 
 /**
-**     Set hit-point regeneration
-**
-**     @param flag     Flag enabling or disabling it.
-**
-**     @return         The old state of the hit-point regeneration.
-*/
-local SCM CclSetHitPointRegeneration(SCM flag)
-{
-    int old;
-
-    old = HitPointRegeneration;
-    HitPointRegeneration = gh_scm2bool(flag);
-
-    return gh_bool2scm(old);
-}
-
-/**
 **  Set xp damage
 **
 **  @param flag Flag enabling or disabling it.
@@ -1178,8 +1161,6 @@
 */
 global void UnitCclRegister(void)
 {
-    gh_new_procedure1_0("set-hitpoint-regeneration!",
-       CclSetHitPointRegeneration);
     gh_new_procedure1_0("set-xp-damage!", CclSetXpDamage);
     gh_new_procedure1_0("set-training-queue!", CclSetTrainingQueue);
     gh_new_procedure1_0("set-building-capture!", CclSetBuildingCapture);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]