[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src include/spells.h include/stratagu...
From: |
address@hidden |
Subject: |
[Stratagus-CVS] stratagus/src include/spells.h include/stratagu... |
Date: |
2 Feb 2004 23:09:34 +1100 |
CVSROOT: /home/strat
Module name: stratagus
Changes by: <address@hidden> 04/02/02 23:09:34
Modified files:
src/include : spells.h stratagus.h
src/stratagus : script_spell.c spells.c
Log message:
Polymorph can change the player to neutral, or not.
Patches:
Index: stratagus/src/include/spells.h
diff -u stratagus/src/include/spells.h:1.48 stratagus/src/include/spells.h:1.49
--- stratagus/src/include/spells.h:1.48 Mon Jan 19 09:36:25 2004
+++ stratagus/src/include/spells.h Mon Feb 2 23:09:32 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: spells.h,v 1.48 2004/01/18 22:36:25 nobody_ Exp $
+// $Id: spells.h,v 1.49 2004/02/02 12:09:32 nobody_ Exp $
#ifndef __SPELLS_H__
#define __SPELLS_H__
@@ -145,6 +145,7 @@
struct {
UnitType *NewForm; /// The
new form
+ int PlayerNeutral;
/// Convert the unit to the neutral player.
// TODO: temporary polymorphs would be awesome, but
hard to implement
} Polymorph;
Index: stratagus/src/include/stratagus.h
diff -u stratagus/src/include/stratagus.h:1.50
stratagus/src/include/stratagus.h:1.51
--- stratagus/src/include/stratagus.h:1.50 Mon Feb 2 10:30:35 2004
+++ stratagus/src/include/stratagus.h Mon Feb 2 23:09:32 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: stratagus.h,v 1.50 2004/02/01 23:30:35 nobody_ Exp $
+// $Id: stratagus.h,v 1.51 2004/02/02 12:09:32 nobody_ Exp $
#ifndef __STRATAGUS_H__
#define __STRATAGUS_H__
@@ -41,7 +41,7 @@
#define NEW_UNIT_CACHE
// New Lua scripting.
-//#define META_LUA
+#define META_LUA
// Dynamic loading.
//#define DYNAMIC_LOAD
Index: stratagus/src/stratagus/script_spell.c
diff -u stratagus/src/stratagus/script_spell.c:1.40
stratagus/src/stratagus/script_spell.c:1.41
--- stratagus/src/stratagus/script_spell.c:1.40 Tue Jan 20 10:24:40 2004
+++ stratagus/src/stratagus/script_spell.c Mon Feb 2 23:09:33 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: script_spell.c,v 1.40 2004/01/19 23:24:40 nobody_ Exp $
+// $Id: script_spell.c,v 1.41 2004/02/02 12:09:33 nobody_ Exp $
//@{
/*----------------------------------------------------------------------------
@@ -344,12 +344,15 @@
lua_rawgeti(l, -1, j + 1);
value = LuaToString(l, -1);
lua_pop(l, 1);
- spellaction->Data.Summon.UnitType =
UnitTypeByIdent(value);
- if (!spellaction->Data.Summon.UnitType) {
- spellaction->Data.Summon.UnitType = 0;
+ spellaction->Data.Polymorph.NewForm =
UnitTypeByIdent(value);
+ if (!spellaction->Data.Polymorph.NewForm) {
+ spellaction->Data.Polymorph.NewForm= 0;
DebugLevel0("unit type \"%s\" not found
for polymorph spell.\n" _C_ value);
}
// FIXME: temp polymorphs? hard to do.
+ } else if (!strcmp(value, "player-neutral")) {
+ spellaction->Data.Polymorph.PlayerNeutral = 1;
+ --j;
} else {
lua_pushfstring(l, "Unsupported polymorph tag:
%s", value);
lua_error(l);
Index: stratagus/src/stratagus/spells.c
diff -u stratagus/src/stratagus/spells.c:1.144
stratagus/src/stratagus/spells.c:1.145
--- stratagus/src/stratagus/spells.c:1.144 Mon Feb 2 10:12:30 2004
+++ stratagus/src/stratagus/spells.c Mon Feb 2 23:09:33 2004
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: spells.c,v 1.144 2004/02/01 23:12:30 nobody_ Exp $
+// $Id: spells.c,v 1.145 2004/02/02 12:09:33 nobody_ Exp $
/*
** And when we cast our final spell
@@ -610,7 +610,11 @@
}
if (canplace) {
caster->Mana -= spell->ManaCost;
- MakeUnitAndPlace(x, y, type, Players + PlayerNumNeutral);
+ if (action->Data.Polymorph.PlayerNeutral) {
+ MakeUnitAndPlace(x, y, type, Players +
PlayerNumNeutral);
+ } else {
+ MakeUnitAndPlace(x, y, type, target->Player);
+ }
UnitLost(target);
UnitClearOrders(target);
ReleaseUnit(target);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src include/spells.h include/stratagu...,
address@hidden <=