stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src action/action_follow.c action/com...


From: Crestez Leonard
Subject: [Stratagus-CVS] stratagus/src action/action_follow.c action/com...
Date: Tue, 04 Nov 2003 17:54:36 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Crestez Leonard <address@hidden>        03/11/04 17:54:36

Modified files:
        src/action     : action_follow.c command.c 
        src/clone      : spells.c 
        src/ui         : mouse.c 

Log message:
        spawn-portal spell works, so does the tunnel in magnant.

Patches:
Index: stratagus/src/action/action_follow.c
diff -u stratagus/src/action/action_follow.c:1.32 
stratagus/src/action/action_follow.c:1.33
--- stratagus/src/action/action_follow.c:1.32   Fri Oct 17 02:04:29 2003
+++ stratagus/src/action/action_follow.c        Tue Nov  4 17:54:34 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: action_follow.c,v 1.32 2003/10/17 06:04:29 mr-russ Exp $
+//     $Id: action_follow.c,v 1.33 2003/11/04 22:54:34 n0body Exp $
 
 //@{
 
@@ -136,23 +136,23 @@
            if ((goal = unit->Orders[0].Goal) && 
                    goal->Type->Teleporter && goal->Goal &&
                    MapDistanceBetweenUnits(unit, goal) < 4) {
-               Unit* table[UnitMax];
+               //Unit* table[UnitMax];
                Unit* dest;
-               int n;
-               int i;
+               //int n;
+               //int i;
 
                RemoveUnit(unit, NULL);
                unit->X = goal->Goal->X;
                unit->Y = goal->Goal->Y;
                DropOutOnSide(unit, unit->Direction, 1, 1);
                //FIXME: SoundIdForName() should be called once
-               PlayGameSound(SoundIdForName("invisibility"), MaxSampleVolume);
+/*             PlayGameSound(SoundIdForName("invisibility"), MaxSampleVolume);
                //FIXME: MissileTypeByIdent() should be called once
                MakeMissile(MissileTypeByIdent("missile-normal-spell"),
                    unit->X * TileSizeX + TileSizeX / 2,
                    unit->Y * TileSizeY + TileSizeY / 2,
                    unit->X * TileSizeX + TileSizeX / 2,
-                   unit->Y * TileSizeY + TileSizeY / 2);
+                   unit->Y * TileSizeY + TileSizeY / 2);*/
 
                unit->Wait = 1;
                unit->SubAction = 0;
@@ -161,13 +161,7 @@
                //
                //      FIXME: we must check if the units supports the new 
order.
                //
-               dest = NoUnitP;
-               n = SelectUnitsOnTile(goal->Goal->X, goal->Goal->Y, table);
-               for (i = 0; i < n; ++i) {
-                   if (table[i]->Type == 
UnitTypeByIdent("unit-circle-of-power")) {
-                       dest = table[i];
-                   }
-               }
+               dest = goal->Goal;
 
                if (dest) {
                    if ((dest->NewOrder.Action == UnitActionResource &&
@@ -177,7 +171,8 @@
                            (dest->NewOrder.Action == UnitActionBoard &&
                                unit->Type->UnitType != UnitTypeLand)) {
                        DebugLevel0Fn("Wrong order for unit\n");
-                       unit->Orders[0].Action = UnitActionStill;
+                       unit->Orders->Action = UnitActionStill;
+                       unit->Orders->Goal = NoUnitP;
                    } else {
                        if (dest->NewOrder.Goal) {
                            if (dest->NewOrder.Goal->Destroyed) {
Index: stratagus/src/action/command.c
diff -u stratagus/src/action/command.c:1.113 
stratagus/src/action/command.c:1.114
--- stratagus/src/action/command.c:1.113        Tue Oct 28 15:20:41 2003
+++ stratagus/src/action/command.c      Tue Nov  4 17:54:34 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: command.c,v 1.113 2003/10/28 20:20:41 n0body Exp $
+//     $Id: command.c,v 1.114 2003/11/04 22:54:34 n0body Exp $
 
 //@{
 
@@ -1188,7 +1188,7 @@
     }
 #endif
 
-    DebugLevel3Fn(": %d spell-casts on %d\n" _C_
+    DebugLevel0Fn(": %d spell-casts on %d\n" _C_
        UnitNumber(unit) _C_ dest ? UnitNumber(dest) : 0);
 
     //
Index: stratagus/src/clone/spells.c
diff -u stratagus/src/clone/spells.c:1.119 stratagus/src/clone/spells.c:1.120
--- stratagus/src/clone/spells.c:1.119  Tue Oct 28 20:55:32 2003
+++ stratagus/src/clone/spells.c        Tue Nov  4 17:54:34 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: spells.c,v 1.119 2003/10/29 01:55:32 n0body Exp $
+//     $Id: spells.c,v 1.120 2003/11/04 22:54:34 n0body Exp $
 
 /*
 **     And when we cast our final spell
@@ -190,17 +190,18 @@
 
     ptype = spell->Action->Data.SpawnPortal.PortalType;
 
+    DebugLevel0Fn("Spawning a portal exit.\n");
     portal = caster->Goal;
     if (portal) {
        // FIXME: if cop is already defined --> move it, but it doesn't work?
        RemoveUnit(portal, NULL);
        PlaceUnit(portal, x, y);
     } else {
-       portal = MakeUnitAndPlace(x, y, ptype, &Players[PlayerMax - 1]);
+       portal = MakeUnitAndPlace(x, y, ptype, caster->Player);
     }
-    MakeMissile(spell->Missile,
+/*    MakeMissile(spell->Missile,
        x * TileSizeX + TileSizeX / 2, y * TileSizeY + TileSizeY / 2,
-       x * TileSizeX + TileSizeX / 2, y * TileSizeY + TileSizeY / 2);
+       x * TileSizeX + TileSizeX / 2, y * TileSizeY + TileSizeY / 2);*/
     //  Goal is used to link to destination circle of power
     caster->Goal = portal;
     RefsDebugCheck(!portal->Refs || portal->Destroyed);
@@ -1200,8 +1201,8 @@
        y=caster->Y;
        target=caster;
     }
-    DebugLevel3Fn("Spell cast: (%s), %s -> %s (%d,%d)\n" _C_ spell->IdentName 
_C_
-       unit->Type->Name _C_ target ? target->Type->Name : "none" _C_ x _C_ y);
+    DebugLevel0Fn("Spell cast: (%s), %s -> %s (%d,%d)\n" _C_ spell->IdentName 
_C_
+       caster->Type->Name _C_ target ? target->Type->Name : "none" _C_ x _C_ 
y);
     if (CanCastSpell(caster, spell, target, x, y)) {
        act=spell->Action;
        cont=1;
Index: stratagus/src/ui/mouse.c
diff -u stratagus/src/ui/mouse.c:1.161 stratagus/src/ui/mouse.c:1.162
--- stratagus/src/ui/mouse.c:1.161      Sun Nov  2 19:57:48 2003
+++ stratagus/src/ui/mouse.c    Tue Nov  4 17:54:35 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: mouse.c,v 1.161 2003/11/03 00:57:48 jsalmon3 Exp $
+//     $Id: mouse.c,v 1.162 2003/11/04 22:54:35 n0body Exp $
 
 //@{
 
@@ -1062,6 +1062,8 @@
     for (i = 0; i < NumSelected; ++i) {
        unit = Selected[i];
        if (!unit->Type->CanCastSpell) {
+           DebugLevel0Fn("but unit %d(%s) can't cast spells?\n"
+                   _C_ unit->Slow _C_ unit->Type->Name);
            continue;                   // this unit cannot cast spell
        }
        if (dest && unit == dest) {




reply via email to

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