[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus data/ccl/human/units.ccl data/ccl/orc...
From: |
Russell Smith |
Subject: |
[Stratagus-CVS] stratagus data/ccl/human/units.ccl data/ccl/orc... |
Date: |
Mon, 01 Sep 2003 08:32:18 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Russell Smith <address@hidden> 03/09/01 08:32:17
Modified files:
data/ccl/human : units.ccl
data/ccl/orc : units.ccl
doc : ChangeLog.html
doc/ccl : unittype.html
src/action : action_build.c action_repair.c command.c
src/ai : ai_resource.c
src/include : stratagus.h unittype.h
src/ui : mouse.c
src/unit : ccl_unittype.c unittype.c
Log message:
Changed can-repair to repair-range, allows flexible repair distances
Patches:
Index: stratagus/data/ccl/human/units.ccl
diff -u stratagus/data/ccl/human/units.ccl:1.29
stratagus/data/ccl/human/units.ccl:1.30
--- stratagus/data/ccl/human/units.ccl:1.29 Sun Aug 31 06:46:59 2003
+++ stratagus/data/ccl/human/units.ccl Mon Sep 1 08:32:15 2003
@@ -1,4 +1,4 @@
-;; _________ __ __
+;; _________ __ __
;; / _____// |_____________ _/ |______ ____ __ __ ______
;; \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
;; / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
@@ -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.29 2003/08/31 10:46:59 mr-russ Exp $
+;; $Id: units.ccl,v 1.30 2003/09/01 12:32:15 mr-russ Exp $
;;=============================================================================
;; Define unit-types.
@@ -53,7 +53,7 @@
'corpse '(unit-dead-body 6)
'type-land
'right-attack
- 'can-attack 'can-repair
+ 'can-attack 'repair-range 1
'can-target-land
'land-unit
'organic
@@ -87,7 +87,7 @@
'corpse '(unit-dead-body 6)
'type-land
'right-harvest
- 'can-attack 'can-repair
+ 'can-attack 'repair-range 1
'can-target-land
'land-unit
'coward
@@ -123,7 +123,7 @@
'corpse '(unit-dead-body 6)
'type-land
'right-harvest
- 'can-attack 'can-repair
+ 'can-attack 'repair-range 1
'can-target-land
'land-unit
'coward
@@ -159,7 +159,7 @@
'corpse '(unit-dead-body 6)
'type-land
'right-harvest
- 'can-attack 'can-repair
+ 'can-attack 'repair-range 1
'can-target-land
'land-unit
'coward
Index: stratagus/data/ccl/orc/units.ccl
diff -u stratagus/data/ccl/orc/units.ccl:1.33
stratagus/data/ccl/orc/units.ccl:1.34
--- stratagus/data/ccl/orc/units.ccl:1.33 Sun Aug 31 06:47:01 2003
+++ stratagus/data/ccl/orc/units.ccl Mon Sep 1 08:32:16 2003
@@ -1,4 +1,4 @@
-;; _________ __ __
+;; _________ __ __
;; / _____// |_____________ _/ |______ ____ __ __ ______
;; \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
;; / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
@@ -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.33 2003/08/31 10:47:01 mr-russ Exp $
+;; $Id: units.ccl,v 1.34 2003/09/01 12:32:16 mr-russ Exp $
;;=============================================================================
;; Define unit-types.
@@ -83,7 +83,7 @@
'corpse '(unit-dead-body 0)
'type-land
'right-harvest
- 'can-attack 'can-repair
+ 'can-attack 'repair-range 1
'can-target-land
'land-unit
'coward
@@ -118,7 +118,7 @@
'corpse '(unit-dead-body 0)
'type-land
'right-harvest
- 'can-attack 'can-repair
+ 'can-attack 'repair-range 1
'can-target-land
'land-unit
'coward
@@ -153,7 +153,7 @@
'corpse '(unit-dead-body 0)
'type-land
'right-harvest
- 'can-attack 'can-repair
+ 'can-attack 'repair-range 1
'can-target-land
'land-unit
'coward
Index: stratagus/doc/ChangeLog.html
diff -u stratagus/doc/ChangeLog.html:1.518 stratagus/doc/ChangeLog.html:1.519
--- stratagus/doc/ChangeLog.html:1.518 Sun Aug 31 06:47:01 2003
+++ stratagus/doc/ChangeLog.html Mon Sep 1 08:32:16 2003
@@ -2,7 +2,7 @@
<html>
<head>
<!--
----- $Id: ChangeLog.html,v 1.518 2003/08/31 10:47:01 mr-russ Exp $
+---- $Id: ChangeLog.html,v 1.519 2003/09/01 12:32:16 mr-russ Exp $
---- (c) Copyright 1998-2003 by Lutz Sammer
@@ -36,6 +36,7 @@
<li>Future 1.19 Release<p>
<ul>
<li>++
+ <li>Changed can-repair to repair-range, allows flexible repair distances
(from Russell Smith).
<li>Added Income improvements to ccl, removed hard coded versions (from
Russell Smith).
<li>Fixed Pathfinder cost bug, which stopped units from moving (from
Russell Smith).
<li>Fixed Pathfinder bug and cleaned up vision table management (from
Russell Smith).
Index: stratagus/doc/ccl/unittype.html
diff -u stratagus/doc/ccl/unittype.html:1.21
stratagus/doc/ccl/unittype.html:1.22
--- stratagus/doc/ccl/unittype.html:1.21 Sun Aug 31 06:47:01 2003
+++ stratagus/doc/ccl/unittype.html Mon Sep 1 08:32:16 2003
@@ -201,7 +201,7 @@
box_size attack_range computer_reaction_range human_reaction_range armor
priorty damage piercing_damge weapon_upgradable armor_upgradeable
decay annoy_factor points missle corpse type right_mouse can_target
- flags sounds attack_sound)</code>
+ repair_range flags sounds attack_sound)</code>
<dl>
<dt>ident</dt>
@@ -325,6 +325,8 @@
<dd></dd>
<dt>can_target</dt>
<dd></dd>
+<dt>repair_range</dt>
+<dd>Range that a unit can repair from, eg. repair_range 1</dd>
<dt>flags</dt>
<dd></dd>
<dt>sounds</dt>
@@ -357,7 +359,7 @@
'corpse-human
'type-land
'right-attack
- 'can-target-land
+ 'can-target-land
;; flags
'land-unit
'can-attack
@@ -620,7 +622,7 @@
<h4>Not Used</h4>
<hr>
-Last changed: $Id: unittype.html,v 1.21 2003/08/31 10:47:01 mr-russ Exp $<br>
+Last changed: $Id: unittype.html,v 1.22 2003/09/01 12:32:16 mr-russ 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/action_build.c
diff -u stratagus/src/action/action_build.c:1.92
stratagus/src/action/action_build.c:1.93
--- stratagus/src/action/action_build.c:1.92 Thu Aug 28 18:51:41 2003
+++ stratagus/src/action/action_build.c Mon Sep 1 08:32:17 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_build.c,v 1.92 2003/08/28 22:51:41 n0body Exp $
+// $Id: action_build.c,v 1.93 2003/09/01 12:32:17 mr-russ Exp $
//@{
@@ -296,7 +296,7 @@
unit->Orders[0].Action=UnitActionRepair;
unit->Orders[0].Goal=build;
unit->Orders[0].X=unit->Orders[0].Y=-1;
- unit->Orders[0].RangeX=unit->Orders[0].RangeY=REPAIR_RANGE;
+ unit->Orders[0].RangeX=unit->Orders[0].RangeY=unit->Type->RepairRange;
unit->SubAction=0;
unit->Wait=1;
RefsDebugCheck( !build->Refs );
Index: stratagus/src/action/action_repair.c
diff -u stratagus/src/action/action_repair.c:1.49
stratagus/src/action/action_repair.c:1.50
--- stratagus/src/action/action_repair.c:1.49 Sun Aug 24 14:48:03 2003
+++ stratagus/src/action/action_repair.c Mon Sep 1 08:32:17 2003
@@ -1,4 +1,4 @@
-// _________ __ __
+// _________ __ __
// / _____// |_____________ _/ |______ ____ __ __ ______
// \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_repair.c,v 1.49 2003/08/24 18:48:03 n0body Exp $
+// $Id: action_repair.c,v 1.50 2003/09/01 12:32:17 mr-russ Exp $
//@{
@@ -285,7 +285,7 @@
//
// Have reached target? FIXME: could use return value
//
- if(goal&&MapDistanceToUnit(unit->X,unit->Y,goal)<=REPAIR_RANGE
+
if(goal&&MapDistanceToUnit(unit->X,unit->Y,goal)<=unit->Type->RepairRange
&&goal->HP<goal->Type->Stats->HitPoints) {
unit->State=0;
unit->SubAction=2;
Index: stratagus/src/action/command.c
diff -u stratagus/src/action/command.c:1.101
stratagus/src/action/command.c:1.102
--- stratagus/src/action/command.c:1.101 Mon Aug 25 07:21:15 2003
+++ stratagus/src/action/command.c Mon Sep 1 08:32:17 2003
@@ -1,4 +1,4 @@
-// _________ __ __
+// _________ __ __
// / _____// |_____________ _/ |______ ____ __ __ ______
// \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: command.c,v 1.101 2003/08/25 11:21:15 mr-russ Exp $
+// $Id: command.c,v 1.102 2003/09/01 12:32:17 mr-russ Exp $
//@{
@@ -373,13 +373,13 @@
order->Goal=dest;
RefsDebugCheck( !dest->Refs );
dest->Refs++;
- order->RangeX=order->RangeY=REPAIR_RANGE;
+ order->RangeX=order->RangeY=unit->Type->RepairRange;
}
} else {
order->X=x;
order->Y=y;
order->Goal=NoUnitP;
- order->RangeX=order->RangeY=REPAIR_RANGE;
+ order->RangeX=order->RangeY=unit->Type->RepairRange;
}
order->Type=NULL;
order->Arg1=NULL;
@@ -670,8 +670,8 @@
order->X=x;
order->Y=y;
if(what->BuilderOutside) {
- order->RangeX=REPAIR_RANGE;
- order->RangeY=REPAIR_RANGE;
+ order->RangeX=unit->Type->RepairRange;
+ order->RangeY=unit->Type->RepairRange;
} else {
// If building inside, but be next to stop
order->RangeX=1;
Index: stratagus/src/ai/ai_resource.c
diff -u stratagus/src/ai/ai_resource.c:1.64 stratagus/src/ai/ai_resource.c:1.65
--- stratagus/src/ai/ai_resource.c:1.64 Sun Aug 24 14:48:03 2003
+++ stratagus/src/ai/ai_resource.c Mon Sep 1 08:32:17 2003
@@ -1,4 +1,4 @@
-// _________ __ __
+// _________ __ __
// / _____// |_____________ _/ |______ ____ __ __ ______
// \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ai_resource.c,v 1.64 2003/08/24 18:48:03 n0body Exp $
+// $Id: ai_resource.c,v 1.65 2003/09/01 12:32:17 mr-russ Exp $
#ifdef NEW_AI // {
@@ -1519,7 +1519,7 @@
nunits = FindPlayerUnitsByType(AiPlayer->Player,type,table);
for (num = i = 0; i < nunits; i++) {
unit = table[i];
- if ( unit->Type->CanRepair &&
+ if ( unit->Type->RepairRange &&
(unit->Orders[0].Action==UnitActionResource ||
unit->Orders[0].Action==UnitActionStill) &&
unit->OrderCount==1 ) {
@@ -1569,7 +1569,7 @@
unit=table[i];
DebugLevel2Fn("Have an unit to repair %d :)\n" _C_ UnitNumber(unit));
- if( UnitReachable(unit,building,REPAIR_RANGE) ) {
+ if( UnitReachable(unit,building,unit->Type->RepairRange) ) {
CommandRepair(unit, 0, 0, building,FlushCommands);
return 1;
}
Index: stratagus/src/include/stratagus.h
diff -u stratagus/src/include/stratagus.h:1.9
stratagus/src/include/stratagus.h:1.10
--- stratagus/src/include/stratagus.h:1.9 Fri Aug 8 06:16:44 2003
+++ stratagus/src/include/stratagus.h Mon Sep 1 08:32:17 2003
@@ -1,4 +1,4 @@
-// _________ __ __
+// _________ __ __
// / _____// |_____________ _/ |______ ____ __ __ ______
// \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: stratagus.h,v 1.9 2003/08/08 10:16:44 martinxyz Exp $
+// $Id: stratagus.h,v 1.10 2003/09/01 12:32:17 mr-russ Exp $
#ifndef __STRATAGUS_H__
#define __STRATAGUS_H__
@@ -557,9 +557,6 @@
/// How near could a depot be build to a resource
#define RESOURCE_DISTANCE 3
-
- /// How near we could repair an unit
-#define REPAIR_RANGE 1
//@}
Index: stratagus/src/include/unittype.h
diff -u stratagus/src/include/unittype.h:1.100
stratagus/src/include/unittype.h:1.101
--- stratagus/src/include/unittype.h:1.100 Thu Aug 28 18:51:42 2003
+++ stratagus/src/include/unittype.h Mon Sep 1 08:32:17 2003
@@ -1,4 +1,4 @@
-// _________ __ __
+// _________ __ __
// / _____// |_____________ _/ |______ ____ __ __ ______
// \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unittype.h,v 1.100 2003/08/28 22:51:42 n0body Exp $
+// $Id: unittype.h,v 1.101 2003/09/01 12:32:17 mr-russ Exp $
#ifndef __UNITTYPE_H__
#define __UNITTYPE_H__
@@ -397,12 +397,14 @@
**
** Unit is able to attack.
**
-** UnitType::CanRepair
+** UnitType::RepairRange
**
** Unit can repair buildings. It will use the actack animation.
** It will heal 4 points for every repair cycle, and cost 1 of
** each resource, alternatively(1 cycle wood, 1 cycle gold)
** FIXME: The above should be more configurable.
+** If units have a repair range, they can repair, and this is the
+** distance.
**
** UnitType::BuilderOutside
**
@@ -665,7 +667,7 @@
unsigned ShoreBuilding : 1; /// Building must be build on
coast.
unsigned CanCastSpell : 1; /// Unit is able to use spells.
unsigned CanAttack : 1; /// Unit can attack.
- unsigned CanRepair : 1; /// Unit can repair .
+ unsigned int RepairRange; /// Units repair range.
unsigned BuilderOutside : 1; /// The builder stays outside during
the build.
unsigned BuilderLost : 1; /// The builder is lost after the build.
// FIXME: n0body: AutoBuildRate not implemented.
Index: stratagus/src/ui/mouse.c
diff -u stratagus/src/ui/mouse.c:1.141 stratagus/src/ui/mouse.c:1.142
--- stratagus/src/ui/mouse.c:1.141 Thu Aug 21 17:55:45 2003
+++ stratagus/src/ui/mouse.c Mon Sep 1 08:32:17 2003
@@ -1,4 +1,4 @@
-// _________ __ __
+// _________ __ __
// / _____// |_____________ _/ |______ ____ __ __ ______
// \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mouse.c,v 1.141 2003/08/21 21:55:45 n0body Exp $
+// $Id: mouse.c,v 1.142 2003/09/01 12:32:17 mr-russ Exp $
//@{
@@ -234,7 +234,7 @@
}
}
// Go and repair
- if ( (unit->Type->CanRepair) && dest &&
+ if ( (unit->Type->RepairRange) && dest &&
(dest->Type->Building || dest->Type->Transporter) &&
dest->HP < dest->Stats->HitPoints &&
(dest->Player==unit->Player || IsAllied(dest->Player,dest))
) {
@@ -777,7 +777,7 @@
(dest->Player==ThisPlayer||IsAllied(ThisPlayer,dest))) {
for( i=0; i<NumSelected; ++i ) {
unit=Selected[i];
- if( unit->Type->CanRepair ) {
+ if( unit->Type->RepairRange ) {
SendCommandRepair(unit,x,y,dest,!(KeyModifiers&ModifierShift));
} else {
DebugLevel0Fn("Non-worker repairs\n");
Index: stratagus/src/unit/ccl_unittype.c
diff -u stratagus/src/unit/ccl_unittype.c:1.78
stratagus/src/unit/ccl_unittype.c:1.79
--- stratagus/src/unit/ccl_unittype.c:1.78 Sun Aug 31 06:47:01 2003
+++ stratagus/src/unit/ccl_unittype.c Mon Sep 1 08:32:17 2003
@@ -1,4 +1,4 @@
-// _________ __ __
+// _________ __ __
// / _____// |_____________ _/ |______ ____ __ __ ______
// \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_unittype.c,v 1.78 2003/08/31 10:47:01 mr-russ Exp $
+// $Id: ccl_unittype.c,v 1.79 2003/09/01 12:32:17 mr-russ Exp $
//@{
@@ -375,9 +375,9 @@
type->GroundAttack=1;
} else if( gh_eq_p(value,gh_symbol2scm("can-attack")) ) {
type->CanAttack=1;
- } else if( gh_eq_p(value,gh_symbol2scm("can-repair")) ) {
- type->CanRepair=1;
-
+ } else if( gh_eq_p(value,gh_symbol2scm("repair-range")) ) {
+ type->RepairRange=gh_scm2int(gh_car(list));
+ list=gh_cdr(list);
} else if( gh_eq_p(value,gh_symbol2scm("can-target-land")) ) {
type->CanTarget|=CanTargetLand;
} else if( gh_eq_p(value,gh_symbol2scm("can-target-sea")) ) {
@@ -548,6 +548,7 @@
} else {
// FIXME: this leaves a half initialized unit-type
printf("\n%s\n",type->Name);
+ DebugCheck( 1 );
errl("Unsupported tag",value);
}
}
Index: stratagus/src/unit/unittype.c
diff -u stratagus/src/unit/unittype.c:1.90 stratagus/src/unit/unittype.c:1.91
--- stratagus/src/unit/unittype.c:1.90 Sun Aug 31 06:47:01 2003
+++ stratagus/src/unit/unittype.c Mon Sep 1 08:32:17 2003
@@ -1,4 +1,4 @@
-// _________ __ __
+// _________ __ __
// / _____// |_____________ _/ |______ ____ __ __ ______
// \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unittype.c,v 1.90 2003/08/31 10:47:01 mr-russ Exp $
+// $Id: unittype.c,v 1.91 2003/09/01 12:32:17 mr-russ Exp $
//@{
@@ -819,8 +819,8 @@
if( type->CanAttack ) {
CLprintf(file," 'can-attack\n");
}
- if( type->CanRepair ) {
- CLprintf(file," 'can-repair\n");
+ if( type->RepairRange ) {
+ CLprintf(file," 'repair-range %d\n",type->RepairRange);
}
if( type->CanTarget ) {
CLprintf(file," ");
@@ -1040,7 +1040,7 @@
char **sp;
CLprintf(file,"\n;;; -----------------------------------------\n");
- CLprintf(file,";;; MODULE: unittypes $Id: unittype.c,v 1.90 2003/08/31
10:47:01 mr-russ Exp $\n\n");
+ CLprintf(file,";;; MODULE: unittypes $Id: unittype.c,v 1.91 2003/09/01
12:32:17 mr-russ Exp $\n\n");
// Original number to internal unit-type name.
- [Stratagus-CVS] stratagus data/ccl/human/units.ccl data/ccl/orc...,
Russell Smith <=