[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus data/ccl/spells.ccl data/ccl/human/bu...
From: |
Crestez Leonard |
Subject: |
[Stratagus-CVS] stratagus data/ccl/spells.ccl data/ccl/human/bu... |
Date: |
Thu, 23 Oct 2003 21:58:35 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Crestez Leonard <address@hidden> 03/10/23 21:58:34
Modified files:
data/ccl : spells.ccl
data/ccl/human : buttons.ccl units.ccl
data/ccl/orc : units.ccl
doc : ChangeLog.html
doc/ccl : magic.html unittype.html
src/action : Module.make action_spellcast.c actions.c
command.c
src/clone : selection.c spells.c unit.c unit_draw.c
src/include : actions.h commands.h interface.h network.h
unit.h unittype.h
src/network : commands.c
src/ui : botpanel.c ccl_ui.c mainscr.c mouse.c
src/unit : ccl_unit.c ccl_unittype.c unittype.c upgrade.c
Removed files:
src/action : action_demolish.c
Log message:
Demolish action is now a spell.
Patches:
Index: stratagus/data/ccl/human/buttons.ccl
diff -u stratagus/data/ccl/human/buttons.ccl:1.27
stratagus/data/ccl/human/buttons.ccl:1.28
--- stratagus/data/ccl/human/buttons.ccl:1.27 Thu Oct 23 14:38:33 2003
+++ stratagus/data/ccl/human/buttons.ccl Thu Oct 23 21:58:32 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: buttons.ccl,v 1.27 2003/10/23 18:38:33 n0body Exp $
+;; $Id: buttons.ccl,v 1.28 2003/10/24 01:58:32 n0body Exp $
;;----------------------------------------------------------------------------
;; Define unit-button.
@@ -149,10 +149,10 @@
'for-unit '(unit-ballista unit-battleship human-group))
(define-button 'pos 9 'level 0 'icon 'icon-alliance-demolish
- 'action 'demolish
+ 'action 'cast-spell 'value 'spell-suicide-bomber
+ 'allowed 'check-true
'key "d" 'hint "~!DEMOLISH"
- 'for-unit '(unit-footman unit-knight unit-archer unit-paladin
- unit-dwarves unit-ranger unit-ballista unit-gryphon-rider human-group))
+ 'for-unit '(unit-dwarves))
;; paladin specific actions ---------------------------------------------------
@@ -218,8 +218,8 @@
'for-unit '(unit-mage unit-white-mage))
(define-button 'pos 8 'level 0 'icon 'icon-polymorph
- 'action 'cast-spell 'value 'spell-polymorph
-; 'action 'cast-spell 'value 'spell-suicide-bomber
+; 'action 'cast-spell 'value 'spell-polymorph
+ 'action 'cast-spell 'value 'spell-suicide-bomber
'allowed 'check-upgrade 'allow-arg '(upgrade-polymorph)
'key "p" 'hint "~!POLYMORPH"
'for-unit '(unit-mage unit-white-mage))
Index: stratagus/data/ccl/human/units.ccl
diff -u stratagus/data/ccl/human/units.ccl:1.45
stratagus/data/ccl/human/units.ccl:1.46
--- stratagus/data/ccl/human/units.ccl:1.45 Thu Oct 23 18:19:14 2003
+++ stratagus/data/ccl/human/units.ccl Thu Oct 23 21:58:32 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: units.ccl,v 1.45 2003/10/23 22:19:14 jsalmon3 Exp $
+;; $Id: units.ccl,v 1.46 2003/10/24 01:58:32 n0body Exp $
;;=============================================================================
;; Define unit-types.
@@ -231,8 +231,7 @@
spell-flame-shield
spell-invisibility
spell-polymorph
- spell-blizzard
- spell-suicide-bomber)
+ spell-blizzard)
'land-unit
'coward
'organic
@@ -294,9 +293,8 @@
'points 100
'demand 1
'type-land
- 'right-demolish
- 'demolish-range 2
- 'demolish-damage 400
+ 'right-spell-cast
+ 'can-cast-spell '(spell-suicide-bomber)
'can-attack
'can-target-land
'land-unit
Index: stratagus/data/ccl/orc/units.ccl
diff -u stratagus/data/ccl/orc/units.ccl:1.47
stratagus/data/ccl/orc/units.ccl:1.48
--- stratagus/data/ccl/orc/units.ccl:1.47 Thu Oct 23 18:19:14 2003
+++ stratagus/data/ccl/orc/units.ccl Thu Oct 23 21:58:32 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: units.ccl,v 1.47 2003/10/23 22:19:14 jsalmon3 Exp $
+;; $Id: units.ccl,v 1.48 2003/10/24 01:58:32 n0body Exp $
;;=============================================================================
;; Define unit-types.
@@ -290,9 +290,8 @@
'points 100
'demand 1
'type-land
- 'right-demolish
- 'demolish-range 2
- 'demolish-damage 400
+ 'right-spell-cast
+ 'can-cast-spell '(spell-suicide-bomber)
'can-attack
'can-target-land
'land-unit
Index: stratagus/data/ccl/spells.ccl
diff -u stratagus/data/ccl/spells.ccl:1.13 stratagus/data/ccl/spells.ccl:1.14
--- stratagus/data/ccl/spells.ccl:1.13 Thu Oct 23 14:38:32 2003
+++ stratagus/data/ccl/spells.ccl Thu Oct 23 21:58:31 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: spells.ccl,v 1.13 2003/10/23 18:38:32 n0body Exp $
+;; $Id: spells.ccl,v 1.14 2003/10/24 01:58:31 n0body Exp $
;; For documentation see stratagus/doc/ccl/ccl.html ;; FIXME write and move
doc.
@@ -95,12 +95,12 @@
(define-spell "spell-suicide-bomber"
'showname "Demolish"
'manacost 0
- 'range 10
- 'target 'position
+ 'target 'self
'action '((demolish range 1 damage 400))
'sound-when-cast "holy vision"
'missile-when-cast "missile-normal-spell"
)
+
(define-spell "spell-holy-vision"
'showname "Holy Vision"
'manacost 70
Index: stratagus/doc/ChangeLog.html
diff -u stratagus/doc/ChangeLog.html:1.559 stratagus/doc/ChangeLog.html:1.560
--- stratagus/doc/ChangeLog.html:1.559 Thu Oct 23 14:38:33 2003
+++ stratagus/doc/ChangeLog.html Thu Oct 23 21:58:32 2003
@@ -2,7 +2,7 @@
<html>
<head>
<!--
----- $Id: ChangeLog.html,v 1.559 2003/10/23 18:38:33 n0body Exp $
+---- $Id: ChangeLog.html,v 1.560 2003/10/24 01:58:32 n0body Exp $
---- (c) Copyright 1998-2003 by Lutz Sammer
@@ -36,6 +36,7 @@
<li>Future 2.00 Release<p>
<ul>
<li>++
+ <li>Removed the demolish action, we now use the demolish spell. (from
Crestez Leonard).
<li>Applied patch #1969 (AI enhancement) (from Ludovic Pollet).
<li>Added the demolish spell, though not complete (from Crestez Leonard).
<li>Added the spawn-missile action, removed fireball death-coil whirlwind
runes flame-shield (from Crestez Leonard).
Index: stratagus/doc/ccl/magic.html
diff -u stratagus/doc/ccl/magic.html:1.4 stratagus/doc/ccl/magic.html:1.5
--- stratagus/doc/ccl/magic.html:1.4 Wed Oct 22 15:28:05 2003
+++ stratagus/doc/ccl/magic.html Thu Oct 23 21:58:32 2003
@@ -311,6 +311,17 @@
2 hit-points for 1 caster mana up to 20 hit-points/10 mana per cast
</dd>
</dl>
+ <dt>demolish</dt>
+ <dl>This will remove any trees/rocks/walls in and inflict a fixed damage
+ to a fixed area. Possible tags:
+ <dt>damage</dt>
+ <dd>Each and every unit in range will receive that damage. FIXME: no
+ support for dampening damage.
+ </dd>
+ <dt>range</dt>
+ <dd>The range of the terrain and unit damage.
+ </dd>
+ </dl>
<dt>summon</dt>
<dl>This will summon a new unit. Possible tags:
<dt>unit-type</dt>
@@ -475,7 +486,7 @@
<hr>
-Last changed: $Id: magic.html,v 1.4 2003/10/22 19:28:05 n0body Exp $<br>
+Last changed: $Id: magic.html,v 1.5 2003/10/24 01:58:32 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/unittype.html
diff -u stratagus/doc/ccl/unittype.html:1.34
stratagus/doc/ccl/unittype.html:1.35
--- stratagus/doc/ccl/unittype.html:1.34 Mon Oct 20 20:18:31 2003
+++ stratagus/doc/ccl/unittype.html Thu Oct 23 21:58:32 2003
@@ -326,9 +326,9 @@
<dd>This should be used for resource gathering units. It will return goods
when
on a deposit and mine when on a resource.
</dd>
- <dt>right-demolish</dt>
- <dd>This is for demolishing units. It will try to demolish instead of
attack (since
- demolishing units can still have a normal attack, but it really shouldn't
be used)
+ <dt>right-spell-cast</dt>
+ <dd>This is an ugly hack for demolishing units. The unit will cast it's
first
+ known spell(in order of spell definition) instead of attacking a hostile
unit.
</dd>
<p></dl>
<dt>can-gather-resource</dt>
@@ -462,13 +462,6 @@
<dt>detect-cloak</dt>
<dd>Unit can detect cloaked units. If an unit is detected other units can
attack it as well\
</dd>
-<dt>demolish-range</dt>
-<dd>If non-zero this is the range for units that can demolish.The demolished
area is a square, sorry.
-</dd>
-<dt>demolish-damage</dt>
-<dd>Damage dealt to unit affected by demolition. This can be 0, in this case
-only terrain will be affected. Units have to be in demolish-range to be
affected.
-</dd>
<dt>random-movement-probablitity</dt>
<dd>When the unit is idle this is the probability that it will take a
step in a random direction, in percents. Usefull for neutral animals.
@@ -749,7 +742,7 @@
<h4>Not Used</h4>
<hr>
-Last changed: $Id: unittype.html,v 1.34 2003/10/21 00:18:31 n0body Exp $<br>
+Last changed: $Id: unittype.html,v 1.35 2003/10/24 01:58:32 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/Module.make
diff -u stratagus/src/action/Module.make:1.8
stratagus/src/action/Module.make:1.9
--- stratagus/src/action/Module.make:1.8 Fri Sep 5 14:10:55 2003
+++ stratagus/src/action/Module.make Thu Oct 23 21:58:33 2003
@@ -26,7 +26,7 @@
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
MODULE = src/action
-MSRC = action_attack.c action_board.c action_build.c action_demolish.c \
+MSRC = action_attack.c action_board.c action_build.c \
action_die.c action_follow.c action_move.c action_patrol.c \
action_repair.c action_research.c action_resource.c \
action_returngoods.c action_spellcast.c action_stand.c \
Index: stratagus/src/action/action_spellcast.c
diff -u stratagus/src/action/action_spellcast.c:1.35
stratagus/src/action/action_spellcast.c:1.36
--- stratagus/src/action/action_spellcast.c:1.35 Fri Oct 17 02:04:30 2003
+++ stratagus/src/action/action_spellcast.c Thu Oct 23 21:58:33 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_spellcast.c,v 1.35 2003/10/17 06:04:30 mr-russ Exp $
+// $Id: action_spellcast.c,v 1.36 2003/10/24 01:58:33 n0body Exp $
/*
** This is inherited from action_attack.c, actually spell casting will
@@ -95,6 +95,7 @@
*/
local void SpellMoveToTarget(Unit* unit)
{
+ SpellType* spell;
Unit* goal;
int err;
@@ -139,17 +140,29 @@
unit->SubAction++; // cast the spell
return;
} else if (err) {
- // goal/spot out of range -- move to target
- unit->Orders[0].Action = UnitActionStill;
- unit->State = unit->SubAction = 0;
-
- if (unit->Orders[0].Goal) { // Release references
- RefsDebugCheck(!unit->Orders[0].Goal->Refs);
- if (!--unit->Orders[0].Goal->Refs) {
- RefsDebugCheck(!unit->Orders[0].Goal->Destroyed);
- ReleaseUnit(unit->Orders[0].Goal);
+ //
+ // Target self-> we don't really have to get in range,
+ // just as close as possible, since the spell is centered
+ // on the caster anyway.
+ //
+ if ((spell = unit->Orders[0].Arg1)->Target == TargetSelf) {
+ DebugLevel0Fn("Increase range for spellcast.");
+ unit->Orders->Range++;
+ } else {
+ //
+ // goal/spot out of range -- give up
+ //
+ unit->Orders[0].Action = UnitActionStill;
+ unit->State = unit->SubAction = 0;
+
+ if (unit->Orders[0].Goal) { // Release references
+ RefsDebugCheck(!unit->Orders[0].Goal->Refs);
+ if (!--unit->Orders[0].Goal->Refs) {
+ RefsDebugCheck(!unit->Orders[0].Goal->Destroyed);
+ ReleaseUnit(unit->Orders[0].Goal);
+ }
+ unit->Orders[0].Goal = NoUnitP;
}
- unit->Orders[0].Goal = NoUnitP;
}
}
DebugCheck(unit->Type->Vanishes || unit->Destroyed);
Index: stratagus/src/action/actions.c
diff -u stratagus/src/action/actions.c:1.99 stratagus/src/action/actions.c:1.100
--- stratagus/src/action/actions.c:1.99 Fri Oct 3 18:42:30 2003
+++ stratagus/src/action/actions.c Thu Oct 23 21:58:33 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: actions.c,v 1.99 2003/10/03 22:42:30 jsalmon3 Exp $
+// $Id: actions.c,v 1.100 2003/10/24 01:58:33 n0body Exp $
//@{
@@ -177,7 +177,7 @@
HandleActionRepair,
HandleActionResource,
HandleActionReturnGoods,
- HandleActionDemolish,
+ HandleActionNotWritten,
HandleActionNotWritten,
// Enough for the future ?
Index: stratagus/src/action/command.c
diff -u stratagus/src/action/command.c:1.110
stratagus/src/action/command.c:1.111
--- stratagus/src/action/command.c:1.110 Sat Oct 18 12:35:19 2003
+++ stratagus/src/action/command.c Thu Oct 23 21:58:33 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: command.c,v 1.110 2003/10/18 16:35:19 jsalmon3 Exp $
+// $Id: command.c,v 1.111 2003/10/24 01:58:33 n0body Exp $
//@{
@@ -1155,74 +1155,6 @@
}
unit->Wait = unit->Reset = 1; // immediately start next command.
- }
- ClearSavedAction(unit);
-}
-
-/**
-** Demolish at position
-**
-** @param unit pointer to unit.
-** @param x X map position to move to.
-** @param y Y map position to move to.
-** @param dest if != NULL, pointer to unit to destroy.
-** @param flush if true, flush command queue.
-*/
-global void CommandDemolish(Unit* unit, int x, int y, Unit* dest, int flush)
-{
- Order* order;
-
-#ifdef DEBUG
- if (x < 0 || y < 0 || x >= TheMap.Width || y >= TheMap.Height) {
- DebugLevel0Fn("Internal movement error\n");
- return;
- }
-#endif
-
- //
- // Check if unit is still valid? (NETWORK!)
- //
- if (!unit->Removed && unit->Orders[0].Action != UnitActionDie) {
- if (unit->Type->Building) {
- // FIXME: should find a better way for pending orders.
- order = &unit->NewOrder;
- ReleaseOrder(order);
- } else if (!(order = GetNextOrder(unit, flush))) {
- return;
- }
-
- order->Action = UnitActionDemolish;
- if (dest) {
- //
- // Destination could be killed.
- // Should be handled in action, but is not possible!
- // Unit::Refs is used as timeout counter.
- //
- if (dest->Destroyed) {
- order->X = dest->X + dest->Type->TileWidth / 2;
- order->Y = dest->Y + dest->Type->TileHeight / 2;
- order->Goal = NoUnitP;
- order->Range = 0;
- } else {
- order->X = order->Y = -1;
- order->Goal = dest;
- RefsDebugCheck(!dest->Refs);
- dest->Refs++;
- order->Range = 1;
- }
- } else if (WallOnMap(x,y) || ForestOnMap(x,y) || RockOnMap(x,y)) {
- order->X = x;
- order->Y = y;
- order->Range = 1;
- order->Goal = NoUnitP;
- } else {
- order->X = x;
- order->Y = y;
- order->Range = 0;
- order->Goal = NoUnitP;
- }
- order->Type = NULL;
- order->Arg1 = NULL;
}
ClearSavedAction(unit);
}
Index: stratagus/src/clone/selection.c
diff -u stratagus/src/clone/selection.c:1.50
stratagus/src/clone/selection.c:1.51
--- stratagus/src/clone/selection.c:1.50 Thu Oct 9 23:56:40 2003
+++ stratagus/src/clone/selection.c Thu Oct 23 21:58:33 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: selection.c,v 1.50 2003/10/10 03:56:40 jsalmon3 Exp $
+// $Id: selection.c,v 1.51 2003/10/24 01:58:33 n0body Exp $
//@{
@@ -104,7 +104,7 @@
// FIXME: make this configurable
if (unit->Value == unit->Type->ClicksToExplode) {
- SendCommandDemolish(unit, unit->X, unit->Y, 0, FlushCommands);
+ LetUnitDie(unit);
unit->Value = 0;
}
}
@@ -975,7 +975,7 @@
char* ref;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: selection $Id: selection.c,v 1.50 2003/10/10
03:56:40 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: selection $Id: selection.c,v 1.51 2003/10/24
01:58:33 n0body Exp $\n\n");
CLprintf(file, "(set-group-id! %d)\n", GroupId);
CLprintf(file, "(selection %d '(", NumSelected);
Index: stratagus/src/clone/spells.c
diff -u stratagus/src/clone/spells.c:1.113 stratagus/src/clone/spells.c:1.114
--- stratagus/src/clone/spells.c:1.113 Thu Oct 23 14:38:35 2003
+++ stratagus/src/clone/spells.c Thu Oct 23 21:58:33 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: spells.c,v 1.113 2003/10/23 18:38:35 n0body Exp $
+// $Id: spells.c,v 1.114 2003/10/24 01:58:33 n0body Exp $
/*
** And when we cast our final spell
@@ -109,10 +109,13 @@
int n;
Unit* table[UnitMax];
- xmin = x - action->Data.Demolish.Range;
- ymin = y - action->Data.Demolish.Range;
- xmax = x + action->Data.Demolish.Range;
- ymax = y + action->Data.Demolish.Range;
+ //
+ // Allow error margnins. (Lame, I know)
+ //
+ xmin = x - action->Data.Demolish.Range - 2;
+ ymin = y - action->Data.Demolish.Range - 2;
+ xmax = x + action->Data.Demolish.Range + 2;
+ ymax = y + action->Data.Demolish.Range + 2;
if (xmin < 0) {
xmin = 0;
}
@@ -130,9 +133,9 @@
// Effect of the explosion on units. Don't bother if damage is 0
//
if (action->Data.Demolish.Damage) {
- n = SelectUnits(xmin, ymin, xmax+1, ymax+1, table);
+ n = SelectUnits(xmin, ymin, xmax, ymax, table);
for (i = 0; i < n; ++i) {
- DebugLevel0("Hit an unit at %d %d?\n" _C_ table[i]->X _C_
table[i]->Y);
+ DebugLevel3("Hit an unit at %d %d?\n" _C_ table[i]->X _C_
table[i]->Y);
if (table[i]->Type->UnitType != UnitTypeFly && table[i]->HP &&
MapDistanceToUnit(x, y, table[i]) <=
action->Data.Demolish.Range) {
// Don't hit flying units!
@@ -1136,6 +1139,14 @@
} else {
x += spell->Range; // Why ??
y += spell->Range; // Why ??
+ }
+ //
+ // For TargetSelf, you target.... YOURSELF
+ //
+ if (spell->Target==TargetSelf) {
+ x=caster->X;
+ 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);
Index: stratagus/src/clone/unit.c
diff -u stratagus/src/clone/unit.c:1.313 stratagus/src/clone/unit.c:1.314
--- stratagus/src/clone/unit.c:1.313 Tue Oct 21 17:31:41 2003
+++ stratagus/src/clone/unit.c Thu Oct 23 21:58:33 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.c,v 1.313 2003/10/21 21:31:41 jsalmon3 Exp $
+// $Id: unit.c,v 1.314 2003/10/24 01:58:33 n0body Exp $
//@{
@@ -3424,10 +3424,6 @@
CLprintf(file, "action-return-goods");
break;
- case UnitActionDemolish:
- CLprintf(file, "action-demolish");
- break;
-
default:
DebugLevel0Fn("Unknown action in order\n");
}
@@ -3734,7 +3730,7 @@
int RunStart;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.313 2003/10/21 21:31:41
jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.314 2003/10/24 01:58:33
n0body Exp $\n\n");
//
// Local variables
Index: stratagus/src/clone/unit_draw.c
diff -u stratagus/src/clone/unit_draw.c:1.172
stratagus/src/clone/unit_draw.c:1.173
--- stratagus/src/clone/unit_draw.c:1.172 Wed Oct 22 15:56:41 2003
+++ stratagus/src/clone/unit_draw.c Thu Oct 23 21:58:33 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit_draw.c,v 1.172 2003/10/22 19:56:41 jsalmon3 Exp $
+// $Id: unit_draw.c,v 1.173 2003/10/24 01:58:33 n0body Exp $
//@{
@@ -577,7 +577,7 @@
global void SaveDecorations(CLFile* file)
{
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.172
2003/10/22 19:56:41 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.173
2003/10/24 01:58:33 n0body Exp $\n\n");
CLprintf(file, "(mana-sprite \"%s\" %d %d %d %d)\n",
ManaSprite.File, ManaSprite.HotX, ManaSprite.HotY,
@@ -1482,11 +1482,6 @@
case UnitActionReturnGoods:
e_color = color = ColorYellow;
- dest = 1;
- break;
-
- case UnitActionDemolish:
- e_color = color = ColorRed;
dest = 1;
break;
Index: stratagus/src/include/actions.h
diff -u stratagus/src/include/actions.h:1.55
stratagus/src/include/actions.h:1.56
--- stratagus/src/include/actions.h:1.55 Sat Sep 27 02:16:37 2003
+++ stratagus/src/include/actions.h Thu Oct 23 21:58:33 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: actions.h,v 1.55 2003/09/27 06:16:37 mr-russ Exp $
+// $Id: actions.h,v 1.56 2003/10/24 01:58:33 n0body Exp $
#ifndef __ACTIONS_H__
#define __ACTIONS_H__
@@ -121,8 +121,6 @@
extern void CommandCancelResearch(Unit* unit);
/// Prepare command upgrade
//extern void CommandUpgradeUnit(Unit* unit,int what,int flush);
- /// Prepare command demolish
-extern void CommandDemolish(Unit* unit,int x,int y,Unit* dest,int flush);
/// Prepare command spellcast
extern void CommandSpellCast(Unit* unit,int x,int y,Unit* dest
,SpellType* spell,int flush);
@@ -179,8 +177,6 @@
extern void HandleActionUpgrade(Unit* unit);
/// Handle command research
extern void HandleActionResearch(Unit* unit);
- /// Handle command demolish
-extern void HandleActionDemolish(Unit* unit);
/// Handle command spellcast
extern void HandleActionSpellCast(Unit* unit);
Index: stratagus/src/include/commands.h
diff -u stratagus/src/include/commands.h:1.22
stratagus/src/include/commands.h:1.23
--- stratagus/src/include/commands.h:1.22 Fri Sep 5 14:10:55 2003
+++ stratagus/src/include/commands.h Thu Oct 23 21:58:33 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: commands.h,v 1.22 2003/09/05 18:10:55 n0body Exp $
+// $Id: commands.h,v 1.23 2003/10/24 01:58:33 n0body Exp $
#ifndef __COMMANDS_H__
#define __COMMANDS_H__
@@ -116,8 +116,6 @@
extern void SendCommandResearch(Unit* unit,Upgrade* what,int flush);
/// Send cancel research command
extern void SendCommandCancelResearch(Unit* unit);
- /// Send demolish command
-extern void SendCommandDemolish(Unit* unit,int x,int y,Unit* dest,int flush);
/// Send spell cast command
extern void SendCommandSpellCast(Unit* unit,int x,int y,Unit* dest,int spellid
,int flush);
Index: stratagus/src/include/interface.h
diff -u stratagus/src/include/interface.h:1.84
stratagus/src/include/interface.h:1.85
--- stratagus/src/include/interface.h:1.84 Mon Oct 13 00:43:18 2003
+++ stratagus/src/include/interface.h Thu Oct 23 21:58:33 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: interface.h,v 1.84 2003/10/13 04:43:18 jsalmon3 Exp $
+// $Id: interface.h,v 1.85 2003/10/24 01:58:33 n0body Exp $
#ifndef __INTERFACE_H__
#define __INTERFACE_H__
@@ -47,16 +47,15 @@
/// Button Commands that need target selection
enum _button_cmd_ {
- ButtonMove, /// order move
- ButtonAttack, /// order attack
- ButtonRepair, /// order repair
- ButtonHarvest, /// order harvest
- ButtonBuild, /// order build
- ButtonPatrol, /// order patrol
- ButtonAttackGround, /// order attack ground
- ButtonSpellCast, /// order cast spell
- ButtonUnload, /// order unload unit
- ButtonDemolish, /// order demolish/explode
+ ButtonMove, /// order move
+ ButtonAttack, /// order attack
+ ButtonRepair, /// order repair
+ ButtonHarvest, /// order harvest
+ ButtonBuild, /// order build
+ ButtonPatrol, /// order patrol
+ ButtonAttackGround, /// order attack ground
+ ButtonSpellCast, /// order cast spell
+ ButtonUnload, /// order unload unit
ButtonStop, /// order stop
ButtonButton, /// choose other button set
ButtonTrain, /// order train
Index: stratagus/src/include/network.h
diff -u stratagus/src/include/network.h:1.41
stratagus/src/include/network.h:1.42
--- stratagus/src/include/network.h:1.41 Mon Sep 29 22:53:02 2003
+++ stratagus/src/include/network.h Thu Oct 23 21:58:33 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: network.h,v 1.41 2003/09/30 02:53:02 jsalmon3 Exp $
+// $Id: network.h,v 1.42 2003/10/24 01:58:33 n0body Exp $
#ifndef __NETWORK_H__
#define __NETWORK_H__
@@ -93,7 +93,6 @@
MessageCommandCancelUpgrade, /// Unit command cancel upgrade
MessageCommandResearch, /// Unit command research
MessageCommandCancelResearch, /// Unit command cancel research
- MessageCommandDemolish, /// Unit command demolish
MessageExtendedCommand, /// Command is the next byte
Index: stratagus/src/include/unit.h
diff -u stratagus/src/include/unit.h:1.222 stratagus/src/include/unit.h:1.223
--- stratagus/src/include/unit.h:1.222 Thu Oct 23 14:38:35 2003
+++ stratagus/src/include/unit.h Thu Oct 23 21:58:33 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.h,v 1.222 2003/10/23 18:38:35 n0body Exp $
+// $Id: unit.h,v 1.223 2003/10/24 01:58:33 n0body Exp $
#ifndef __UNIT_H__
#define __UNIT_H__
@@ -421,9 +421,7 @@
UnitActionRepair, /// unit repairing
UnitActionResource, /// unit harvesting resources
- UnitActionReturnGoods, /// unit returning any resource
-
- UnitActionDemolish, /// unit demolish at
position/unit
+ UnitActionReturnGoods /// unit returning any resource
};
/**
Index: stratagus/src/include/unittype.h
diff -u stratagus/src/include/unittype.h:1.119
stratagus/src/include/unittype.h:1.120
--- stratagus/src/include/unittype.h:1.119 Tue Oct 21 22:42:12 2003
+++ stratagus/src/include/unittype.h Thu Oct 23 21:58:34 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unittype.h,v 1.119 2003/10/22 02:42:12 jsalmon3 Exp $
+// $Id: unittype.h,v 1.120 2003/10/24 01:58:34 n0body Exp $
#ifndef __UNITTYPE_H__
#define __UNITTYPE_H__
@@ -257,17 +257,6 @@
**
** How many points you get for unit. Used in the final score table.
**
-** UnitType::DemolishRange
-**
-** If non-zero This is the range for units that can demolish.
-** The demolished area is a square, sorry.
-**
-** UnitType::DemolishDamage
-**
-** Damage dealt to unit affected by demolition. This can be 0,
-** in this case only terrain will be affected. Units have to be in
-** DemolishRange to be affected.
-**
** UnitType::CanTarget
**
** Which units can it attack
@@ -712,8 +701,6 @@
int _BasicDamage; /// Basic damage dealt
int _PiercingDamage; /// Piercing damage dealt
int _RegenerationRate; /// HP regeneration HP per sec
- int DemolishRange; /// Unit will Demolish around when dead.
- int DemolishDamage; /// Damage dealt to unit affected by
demolition.
int RepairRange; /// Units repair range.
char *CanCastSpell; /// Unit is able to use spells.
// FIXME: n0body: AutoBuildRate not implemented.
@@ -735,7 +722,7 @@
#define MouseActionAttack 1 /// Attack
#define MouseActionMove 2 /// Move
#define MouseActionHarvest 3 /// Harvest resources
-#define MouseActionDemolish 5 /// Demolish
+#define MouseActionSpellCast 5 /// Cast the first spell known
#define MouseActionSail 6 /// Sail
int Points; /// How many points you get for
unit
int CanTarget; /// Which units can it attack
Index: stratagus/src/network/commands.c
diff -u stratagus/src/network/commands.c:1.69
stratagus/src/network/commands.c:1.70
--- stratagus/src/network/commands.c:1.69 Wed Oct 15 21:36:25 2003
+++ stratagus/src/network/commands.c Thu Oct 23 21:58:34 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: commands.c,v 1.69 2003/10/16 01:36:25 jsalmon3 Exp $
+// $Id: commands.c,v 1.70 2003/10/24 01:58:34 n0body Exp $
//@{
@@ -143,7 +143,7 @@
fprintf(LogFile, "(replay-log\n");
fprintf(LogFile, " 'comment\t\"Generated by Stratagus Version "
VERSION "\"\n");
fprintf(LogFile, " 'comment\t\"Visit http://Stratagus.Org for more
information\"\n");
- fprintf(LogFile, " 'comment\t\"$Id: commands.c,v 1.69 2003/10/16
01:36:25 jsalmon3 Exp $\"\n");
+ fprintf(LogFile, " 'comment\t\"$Id: commands.c,v 1.70 2003/10/24
01:58:34 n0body Exp $\"\n");
if (NetworkFildes == (Socket)-1) {
fprintf(LogFile, " 'type\t\"%s\"\n", "single-player");
fprintf(LogFile, " 'race\t%d\n", GameSettings.Presets[0].Race);
@@ -577,8 +577,6 @@
SendCommandResearch(UnitSlots[unit],UpgradeByIdent(val), flags);
} else if (!strcmp(name, "cancel-research")) {
SendCommandCancelResearch(UnitSlots[unit]);
- } else if (!strcmp(name, "demolish")) {
- SendCommandDemolish(UnitSlots[unit], posx, posy, dunit, flags);
} else if (!strcmp(name, "spell-cast")) {
SendCommandSpellCast(UnitSlots[unit], posx, posy, dunit, num, flags);
} else if (!strcmp(name, "auto-spell-cast")) {
@@ -1056,25 +1054,6 @@
}
/**
-** Send command: Unit demolish at position.
-**
-** @param unit pointer to unit.
-** @param x X map tile position where to demolish.
-** @param y Y map tile position where to demolish.
-** @param attack or !=NoUnitP unit to be demolished.
-** @param flush Flag flush all pending commands.
-*/
-global void SendCommandDemolish(Unit* unit, int x, int y, Unit* attack, int
flush)
-{
- if (NetworkFildes == (Socket)-1) {
- CommandLog("demolish", unit, flush, x, y, attack, NULL, -1);
- CommandDemolish(unit, x, y, attack, flush);
- } else {
- NetworkSendCommand(MessageCommandDemolish, unit, x, y, attack, NULL,
flush);
- }
-}
-
-/**
** Send command: Unit spell cast on position/unit.
**
** @param unit pointer to unit.
@@ -1364,15 +1343,6 @@
CommandLog("cancel-research", unit, FlushCommands, -1, -1, NoUnitP,
NULL, -1);
CommandCancelResearch(unit);
- break;
- case MessageCommandDemolish:
- dest = NoUnitP;
- if (dstnr != (unsigned short)0xFFFF) {
- dest = UnitSlots[dstnr];
- DebugCheck(!dest || !dest->Type);
- }
- CommandLog("demolish", unit, status, x, y, dest, NULL, -1);
- CommandDemolish(unit, x, y, dest, status);
break;
default:
id = (msgnr&0x7f) - MessageCommandSpellCast;
Index: stratagus/src/ui/botpanel.c
diff -u stratagus/src/ui/botpanel.c:1.92 stratagus/src/ui/botpanel.c:1.93
--- stratagus/src/ui/botpanel.c:1.92 Fri Oct 17 13:02:20 2003
+++ stratagus/src/ui/botpanel.c Thu Oct 23 21:58:34 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: botpanel.c,v 1.92 2003/10/17 17:02:20 jsalmon3 Exp $
+// $Id: botpanel.c,v 1.93 2003/10/24 01:58:34 n0body Exp $
//@{
@@ -103,7 +103,7 @@
char* cp;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: buttons $Id: botpanel.c,v 1.92 2003/10/17
17:02:20 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: buttons $Id: botpanel.c,v 1.93 2003/10/24
01:58:34 n0body Exp $\n\n");
for (i = 0; i < NumUnitButtons; ++i) {
CLprintf(file, "(define-button 'pos %d 'level %d 'icon '%s\n",
@@ -135,8 +135,6 @@
CLprintf(file, "'attack-ground"); break;
case ButtonReturn:
CLprintf(file, "'return-goods"); break;
- case ButtonDemolish:
- CLprintf(file, "'demolish"); break;
case ButtonSpellCast:
CLprintf(file, "'cast-spell"); break;
case ButtonResearch:
@@ -431,9 +429,6 @@
case ButtonAttack:
action = UnitActionAttack;
break;
- case ButtonDemolish:
- action = UnitActionDemolish;
- break;
case ButtonAttackGround:
action = UnitActionAttackGround;
break;
@@ -616,13 +611,6 @@
break;
}
}
- } else if (UnitButtonTable[z]->Action == ButtonDemolish) {
- for (i = NumSelected; --i;) {
- if (Selected[i]->Type->Volatile) {
- allow = 1;
- break;
- }
- }
} else if (UnitButtonTable[z]->Action == ButtonCancel) {
allow = 1;
} else if (UnitButtonTable[z]->Action == ButtonCancelUpgrade) {
@@ -784,11 +772,6 @@
allow = 1;
}
break;
- case ButtonDemolish:
- if (Selected[0]->Type->Volatile) {
- allow = 1;
- }
- break;
case ButtonTrain:
// Check if building queue is enabled
if (!EnableTrainingQueue &&
@@ -890,7 +873,6 @@
case ButtonAttack:
case ButtonRepair:
case ButtonAttackGround:
- case ButtonDemolish:
case ButtonSpellCast:
if (CurrentButtons[button].Action == ButtonSpellCast &&
(KeyModifiers & ModifierControl)) {
Index: stratagus/src/ui/ccl_ui.c
diff -u stratagus/src/ui/ccl_ui.c:1.140 stratagus/src/ui/ccl_ui.c:1.141
--- stratagus/src/ui/ccl_ui.c:1.140 Tue Oct 21 18:31:32 2003
+++ stratagus/src/ui/ccl_ui.c Thu Oct 23 21:58:34 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_ui.c,v 1.140 2003/10/21 22:31:32 jsalmon3 Exp $
+// $Id: ccl_ui.c,v 1.141 2003/10/24 01:58:34 n0body Exp $
//@{
@@ -2785,8 +2785,6 @@
ba.Action = ButtonAttackGround;
} else if (gh_eq_p(value, gh_symbol2scm("return-goods"))) {
ba.Action = ButtonReturn;
- } else if (gh_eq_p(value, gh_symbol2scm("demolish"))) {
- ba.Action = ButtonDemolish;
} else if (gh_eq_p(value, gh_symbol2scm("cast-spell"))) {
ba.Action = ButtonSpellCast;
} else if (gh_eq_p(value, gh_symbol2scm("research"))) {
Index: stratagus/src/ui/mainscr.c
diff -u stratagus/src/ui/mainscr.c:1.133 stratagus/src/ui/mainscr.c:1.134
--- stratagus/src/ui/mainscr.c:1.133 Mon Oct 13 17:35:56 2003
+++ stratagus/src/ui/mainscr.c Thu Oct 23 21:58:34 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mainscr.c,v 1.133 2003/10/13 21:35:56 jsalmon3 Exp $
+// $Id: mainscr.c,v 1.134 2003/10/24 01:58:34 n0body Exp $
//@{
@@ -527,7 +527,10 @@
}
}
- if (type->CanCastSpell) {
+ //
+ // Unit can cast spell without mana, so only show mana bar for units with
mana
+ //
+ if (type->_MaxMana) {
if (0) {
VideoDrawText(x + 59, y + 8 + 140 + 1, GameFont, "Magic:");
VideoDrawRectangleClip(ColorGray, x + 108, y + 8 + 140, 61, 14);
Index: stratagus/src/ui/mouse.c
diff -u stratagus/src/ui/mouse.c:1.156 stratagus/src/ui/mouse.c:1.157
--- stratagus/src/ui/mouse.c:1.156 Tue Oct 21 22:41:23 2003
+++ stratagus/src/ui/mouse.c Thu Oct 23 21:58:34 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mouse.c,v 1.156 2003/10/22 02:41:23 jsalmon3 Exp $
+// $Id: mouse.c,v 1.157 2003/10/24 01:58:34 n0body Exp $
//@{
@@ -56,6 +56,7 @@
#include "sound.h"
#include "ui.h"
#include "network.h"
+#include "spells.h"
/*----------------------------------------------------------------------------
-- Variables
@@ -110,6 +111,7 @@
int acknowledged;
int flush;
int res;
+ int spellnum;
//
// No unit selected
@@ -259,13 +261,17 @@
//
// Fighters
//
- if (action == MouseActionDemolish || action == MouseActionAttack) {
+ if (action == MouseActionSpellCast || action == MouseActionAttack) {
if (dest) {
if (IsEnemy(unit->Player, dest)) {
dest->Blink = 4;
- if (action == MouseActionDemolish) {
+ if (action == MouseActionSpellCast) {
// This is for demolition squads and such
- SendCommandDemolish(unit, x, y, dest, flush);
+ DebugCheck(!unit->Type->CanCastSpell);
+ for (spellnum=0; !unit->Type->CanCastSpell[spellnum] &&
+ spellnum < SpellTypeCount ; spellnum++) ;
+ DebugCheck(spellnum == SpellTypeCount);
+ SendCommandSpellCast(unit, x, y, dest, spellnum, flush);
} else {
SendCommandAttack(unit, x, y, dest, flush);
}
@@ -946,39 +952,6 @@
}
/**
-** Let a unit explode at selected point
-**
-** @param sx X screen map position
-** @param sy Y screen map position
-*/
-local void SendDemolish(int sx, int sy)
-{
- int i;
- Unit* unit;
- Unit* dest;
- int x;
- int y;
-
- x = sx / TileSizeX;
- y = sy / TileSizeY;
- for (i = 0; i < NumSelected; ++i) {
- unit = Selected[i];
- if (unit->Type->Volatile) {
- // FIXME: choose correct unit no flying ...
- if ((dest = UnitUnderCursor) && CanTarget(unit->Type, dest->Type)) {
- dest->Blink = 4;
- } else {
- dest = NoUnitP;
- }
- SendCommandDemolish(unit, sx / TileSizeX, sy / TileSizeY, dest,
- !(KeyModifiers & ModifierShift));
- } else {
- DebugLevel0Fn("can't demolish %p\n" _C_ unit);
- }
- }
-}
-
-/**
** Let units harvest wood/mine gold/haul oil
**
** @param sx X screen map position
@@ -1118,9 +1091,6 @@
break;
case ButtonUnload:
SendUnload(sx, sy);
- break;
- case ButtonDemolish:
- SendDemolish(sx, sy);
break;
case ButtonSpellCast:
SendSpellCast(sx, sy);
Index: stratagus/src/unit/ccl_unit.c
diff -u stratagus/src/unit/ccl_unit.c:1.69 stratagus/src/unit/ccl_unit.c:1.70
--- stratagus/src/unit/ccl_unit.c:1.69 Fri Oct 17 02:04:32 2003
+++ stratagus/src/unit/ccl_unit.c Thu Oct 23 21:58:34 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_unit.c,v 1.69 2003/10/17 06:04:32 mr-russ Exp $
+// $Id: ccl_unit.c,v 1.70 2003/10/24 01:58:34 n0body Exp $
//@{
@@ -215,8 +215,6 @@
order->Action = UnitActionResource;
} else if (gh_eq_p(value, gh_symbol2scm("action-return-goods"))) {
order->Action = UnitActionReturnGoods;
- } else if (gh_eq_p(value, gh_symbol2scm("action-demolish"))) {
- order->Action = UnitActionDemolish;
} else if (gh_eq_p(value, gh_symbol2scm("flags"))) {
value = gh_car(list);
Index: stratagus/src/unit/ccl_unittype.c
diff -u stratagus/src/unit/ccl_unittype.c:1.97
stratagus/src/unit/ccl_unittype.c:1.98
--- stratagus/src/unit/ccl_unittype.c:1.97 Tue Oct 21 22:42:13 2003
+++ stratagus/src/unit/ccl_unittype.c Thu Oct 23 21:58:34 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_unittype.c,v 1.97 2003/10/22 02:42:13 jsalmon3 Exp $
+// $Id: ccl_unittype.c,v 1.98 2003/10/24 01:58:34 n0body Exp $
//@{
@@ -364,8 +364,8 @@
type->MouseAction = MouseActionMove;
} else if (gh_eq_p(value, gh_symbol2scm("right-harvest"))) {
type->MouseAction = MouseActionHarvest;
- } else if (gh_eq_p(value, gh_symbol2scm("right-demolish"))) {
- type->MouseAction = MouseActionDemolish;
+ } else if (gh_eq_p(value, gh_symbol2scm("right-spell-cast"))) {
+ type->MouseAction = MouseActionSpellCast;
} else if (gh_eq_p(value, gh_symbol2scm("right-sail"))) {
type->MouseAction = MouseActionSail;
@@ -373,12 +373,6 @@
type->GroundAttack = 1;
} else if (gh_eq_p(value, gh_symbol2scm("can-attack"))) {
type->CanAttack = 1;
- } else if (gh_eq_p(value, gh_symbol2scm("demolish-range"))){
- type->DemolishRange = gh_scm2int(gh_car(list));
- list = gh_cdr(list);
- } else if (gh_eq_p(value, gh_symbol2scm("demolish-damage"))){
- type->DemolishDamage = gh_scm2int(gh_car(list));
- list = gh_cdr(list);
} else if (gh_eq_p(value, gh_symbol2scm("repair-range"))) {
type->RepairRange = gh_scm2int(gh_car(list));
list = gh_cdr(list);
@@ -593,14 +587,6 @@
errl("Unsupported tag", value);
DebugCheck(1);
}
- }
-
- //
- // Unit type checks.
- //
- if (type->CanCastSpell && !type->_MaxMana) {
- DebugLevel0Fn("%s: Need max mana value\n" _C_ type->Ident);
- type->_MaxMana = 1;
}
return SCM_UNSPECIFIED;
Index: stratagus/src/unit/unittype.c
diff -u stratagus/src/unit/unittype.c:1.114 stratagus/src/unit/unittype.c:1.115
--- stratagus/src/unit/unittype.c:1.114 Tue Oct 21 22:42:13 2003
+++ stratagus/src/unit/unittype.c Thu Oct 23 21:58:34 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unittype.c,v 1.114 2003/10/22 02:42:13 jsalmon3 Exp $
+// $Id: unittype.c,v 1.115 2003/10/24 01:58:34 n0body Exp $
//@{
@@ -507,13 +507,6 @@
if (BIT(31, v)) DebugLevel0("Unused bit 31 used in %d\n" _C_ i);
#endif
#undef BIT
- //
- // Unit type checks.
- //
- if (unittype->CanCastSpell && !unittype->_MaxMana) {
- DebugLevel0Fn("%s: Need max mana value\n" _C_ unittype->Ident);
- unittype->_MaxMana = 255;
- }
}
// FIXME: peon applies also to peon-with-gold and peon-with-wood
@@ -851,8 +844,8 @@
case MouseActionHarvest:
CLprintf(file, "'right-harvest");
break;
- case MouseActionDemolish:
- CLprintf(file, "'right-demolish");
+ case MouseActionSpellCast:
+ CLprintf(file, "'right-spell-cast");
break;
case MouseActionSail:
CLprintf(file, "'right-sail");
@@ -872,12 +865,6 @@
if (type->RepairRange) {
CLprintf(file, " 'repair-range %d\n", type->RepairRange);
}
- if (type->DemolishRange) {
- CLprintf(file, " 'demolish-range %d\n", type->DemolishRange);
- }
- if (type->DemolishRange) {
- CLprintf(file, " 'demolish-damage %d\n", type->DemolishDamage);
- }
if (type->CanTarget) {
CLprintf(file, " ");
if (type->CanTarget & CanTargetLand) {
@@ -1152,7 +1139,7 @@
char** sp;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: unittypes $Id: unittype.c,v 1.114 2003/10/22
02:42:13 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: unittypes $Id: unittype.c,v 1.115 2003/10/24
01:58:34 n0body Exp $\n\n");
// Original number to internal unit-type name.
@@ -1242,6 +1229,8 @@
}
memset(type, 0, sizeof(UnitType));
type->Type = NumUnitTypes;
+ DebugLevel3Fn("Making a new unit, called %s, branded %d\n"
+ _C_ ident _C_ type->Type);
type->Ident = ident;
UnitTypes[NumUnitTypes++] = type;
//
Index: stratagus/src/unit/upgrade.c
diff -u stratagus/src/unit/upgrade.c:1.61 stratagus/src/unit/upgrade.c:1.62
--- stratagus/src/unit/upgrade.c:1.61 Mon Oct 6 12:22:49 2003
+++ stratagus/src/unit/upgrade.c Thu Oct 23 21:58:34 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: upgrade.c,v 1.61 2003/10/06 16:22:49 jsalmon3 Exp $
+// $Id: upgrade.c,v 1.62 2003/10/24 01:58:34 n0body Exp $
//@{
@@ -544,7 +544,7 @@
int p;
CLprintf(file, "\n;;; -----------------------------------------\n");
- CLprintf(file, ";;; MODULE: upgrades $Id: upgrade.c,v 1.61 2003/10/06
16:22:49 jsalmon3 Exp $\n\n");
+ CLprintf(file, ";;; MODULE: upgrades $Id: upgrade.c,v 1.62 2003/10/24
01:58:34 n0body Exp $\n\n");
/* remove?
//
@@ -1265,7 +1265,7 @@
unit->Type = dst;
unit->Stats = &dst->Stats[player->Player];
// and we have new one...
- player->UnitTypesCount[dst->Type]++;
+
UpdateForNewUnit(unit, 1);
if (dst->CanCastSpell) {
unit->Mana = MAGIC_FOR_NEW_UNITS;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus data/ccl/spells.ccl data/ccl/human/bu...,
Crestez Leonard <=