[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src ai/ai_rules.c include/unittype.h ...
From: |
Russell Smith |
Subject: |
[Stratagus-CVS] stratagus/src ai/ai_rules.c include/unittype.h ... |
Date: |
Tue, 02 Dec 2003 01:13:00 -0500 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Russell Smith <address@hidden> 03/12/02 01:13:00
Modified files:
src/ai : ai_rules.c
src/include : unittype.h
src/unit : ccl_unittype.c unittype.c
Log message:
Applied Patch #2292 Remove Magic flag in unittype (from Joris DAUPHIN)
Patches:
Index: stratagus/src/ai/ai_rules.c
diff -u stratagus/src/ai/ai_rules.c:1.10 stratagus/src/ai/ai_rules.c:1.11
--- stratagus/src/ai/ai_rules.c:1.10 Fri Nov 14 12:34:53 2003
+++ stratagus/src/ai/ai_rules.c Tue Dec 2 01:12:59 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ai_rules.c,v 1.10 2003/11/14 17:34:53 pludov Exp $
+// $Id: ai_rules.c,v 1.11 2003/12/02 06:12:59 mr-russ Exp $
//@{
@@ -313,7 +313,7 @@
unitType->Stats[AiPlayer->Player->Player].PiercingDamage +
unitType->Stats[AiPlayer->Player->Player].Speed / 3 +
unitType->Stats[AiPlayer->Player->Player].HitPoints / 5 +
- (unitType->Magic ? 30 : 0);
+ (unitType->CanCastSpell ? 30 : 0);
if (influence == 0) {
return 1;
}
@@ -367,7 +367,7 @@
unit->Stats->BasicDamage +
unit->Stats->PiercingDamage +
unit->Stats->Speed / 3 +
- unit->Stats->HitPoints / 5 + (unitType->Magic ? 30 : 0);
+ unit->Stats->HitPoints / 5 + (unitType->CanCastSpell ? 30 : 0);
}
if (influence <= 1) {
Index: stratagus/src/include/unittype.h
diff -u stratagus/src/include/unittype.h:1.132
stratagus/src/include/unittype.h:1.133
--- stratagus/src/include/unittype.h:1.132 Sat Nov 29 23:54:12 2003
+++ stratagus/src/include/unittype.h Tue Dec 2 01:12:59 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unittype.h,v 1.132 2003/11/30 04:54:12 jsalmon3 Exp $
+// $Id: unittype.h,v 1.133 2003/12/02 06:12:59 mr-russ Exp $
#ifndef __UNITTYPE_H__
#define __UNITTYPE_H__
@@ -159,10 +159,6 @@
**
** Maximum mana points
**
-** UnitType::Magic
-**
-** Unit is a mage
-**
** UnitType::_Costs[::MaxCosts]
**
** How many resources needed
@@ -666,8 +662,6 @@
int _SightRange; /// Sight range
int _HitPoints; /// Maximum hit points
int _MaxMana; /// Maximum mana points
- // FIXME: only flag
- int Magic; /// Unit can cast spells
int _Costs[MaxCosts]; /// How many resources needed
int RepairHP; /// Amount of HP per repair
Index: stratagus/src/unit/ccl_unittype.c
diff -u stratagus/src/unit/ccl_unittype.c:1.120
stratagus/src/unit/ccl_unittype.c:1.121
--- stratagus/src/unit/ccl_unittype.c:1.120 Mon Dec 1 23:02:37 2003
+++ stratagus/src/unit/ccl_unittype.c Tue Dec 2 01:13:00 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_unittype.c,v 1.120 2003/12/02 04:02:37 jsalmon3 Exp $
+// $Id: ccl_unittype.c,v 1.121 2003/12/02 06:13:00 mr-russ Exp $
//@{
@@ -557,7 +557,10 @@
}
sublist = gh_car(list);
list = gh_cdr(list);
- type->Magic = 0;
+ if (gh_null_p(sublist)) { // empty list
+ free(type->CanCastSpell);
+ type->CanCastSpell = NULL;
+ }
while (!gh_null_p(sublist)) {
int id;
id = CclGetSpellByIdent(gh_car(sublist));
@@ -567,7 +570,6 @@
}
type->CanCastSpell[id] = 1;
sublist = gh_cdr(sublist);
- type->Magic = 1;
}
} else if (gh_eq_p(value, gh_symbol2scm("can-target-flag"))) {
//
Index: stratagus/src/unit/unittype.c
diff -u stratagus/src/unit/unittype.c:1.130 stratagus/src/unit/unittype.c:1.131
--- stratagus/src/unit/unittype.c:1.130 Sat Nov 29 23:54:13 2003
+++ stratagus/src/unit/unittype.c Tue Dec 2 01:13:00 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unittype.c,v 1.130 2003/11/30 04:54:13 jsalmon3 Exp $
+// $Id: unittype.c,v 1.131 2003/12/02 06:13:00 mr-russ Exp $
//@{
@@ -307,9 +307,10 @@
unittype->_HitPoints = v;
}
for (i = 0; i < 110; ++i) { // Flag if unit is magic
- unittype = UnitTypeByWcNum(i);
- v = Fetch8(udta);
- unittype->Magic = v;
+// unittype = UnitTypeByWcNum(i);
+// v = Fetch8(udta);
+// unittype->Magic = v;
+ Fetch8(udta);
}
for (i = 0; i < 110; ++i) { // Build time * 6 = one second
FRAMES
unittype = UnitTypeByWcNum(i);
@@ -1197,7 +1198,7 @@
char** sp;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: unittypes $Id: unittype.c,v 1.130 2003/11/30
04:54:13 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: unittypes $Id: unittype.c,v 1.131 2003/12/02
06:13:00 mr-russ Exp $\n\n");
// Original number to internal unit-type name.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus/src ai/ai_rules.c include/unittype.h ...,
Russell Smith <=