[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: |
Crestez Leonard |
Subject: |
[Stratagus-CVS] stratagus data/ccl/human/units.ccl data/ccl/orc... |
Date: |
Thu, 28 Aug 2003 18:51:43 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Crestez Leonard <address@hidden> 03/08/28 18:51:42
Modified files:
data/ccl/human : units.ccl
data/ccl/orc : units.ccl
src/action : action_build.c action_resource.c actions.c
src/ai : ai_building.c
src/clone : unit_draw.c
src/include : unit.h unittype.h
src/pathfinder : astar.c
src/ui : mainscr.c
src/unit : ccl_unittype.c unittype.c
Log message:
fixed minor bugs.
Patches:
Index: stratagus/data/ccl/human/units.ccl
diff -u stratagus/data/ccl/human/units.ccl:1.27
stratagus/data/ccl/human/units.ccl:1.28
--- stratagus/data/ccl/human/units.ccl:1.27 Mon Aug 25 07:21:14 2003
+++ stratagus/data/ccl/human/units.ccl Thu Aug 28 18:51:41 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.27 2003/08/25 11:21:14 mr-russ Exp $
+;; $Id: units.ccl,v 1.28 2003/08/28 22:51:41 n0body Exp $
;;=============================================================================
;; Define unit-types.
@@ -92,8 +92,9 @@
'land-unit
'coward
'harvester 'resource-harvested 'gold 'resource-capacity 100
- 'wait-at-resource 150 'wait-at-depot 150
+ 'resource-step 10 'wait-at-resource 15 'wait-at-depot 150
'transform-when-loaded 'unit-peasant-with-gold
+;; 'harvest-from-outside
'organic
'selectable-by-rectangle
'sounds '(
@@ -127,8 +128,9 @@
'land-unit
'coward
'harvester 'resource-harvested 'gold 'resource-capacity 100
- 'wait-at-resource 150 'wait-at-depot 150
+ 'resource-step 10 'wait-at-resource 15 'wait-at-depot 150
'transform-when-empty 'unit-peasant
+;;'harvest-from-outside
'organic
'selectable-by-rectangle
'sounds '(
Index: stratagus/data/ccl/orc/units.ccl
diff -u stratagus/data/ccl/orc/units.ccl:1.31
stratagus/data/ccl/orc/units.ccl:1.32
--- stratagus/data/ccl/orc/units.ccl:1.31 Mon Aug 25 07:21:14 2003
+++ stratagus/data/ccl/orc/units.ccl Thu Aug 28 18:51:41 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.31 2003/08/25 11:21:14 mr-russ Exp $
+;; $Id: units.ccl,v 1.32 2003/08/28 22:51:41 n0body Exp $
;;=============================================================================
;; Define unit-types.
@@ -1215,7 +1215,6 @@
'corpse '(unit-destroyed-4x4-place 0)
'type-land
'building
- 'builder-outside
'can-store '(gold wood)
'sounds '(
selected "great-hall-selected"
Index: stratagus/src/action/action_build.c
diff -u stratagus/src/action/action_build.c:1.91
stratagus/src/action/action_build.c:1.92
--- stratagus/src/action/action_build.c:1.91 Mon Aug 25 07:21:15 2003
+++ stratagus/src/action/action_build.c Thu Aug 28 18:51:41 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_build.c,v 1.91 2003/08/25 11:21:15 mr-russ Exp $
+// $Id: action_build.c,v 1.92 2003/08/28 22:51:41 n0body Exp $
//@{
@@ -173,6 +173,7 @@
// Release Temporary Building
UnitClearOrders(unit->Orders[0].Goal);
ReleaseUnit(unit->Orders[0].Goal);
+ unit->Orders[0].Goal=0;
unit->SubAction=0;
if( unit->Selected ) { // update display for new action
SelectedUnitChanged();
Index: stratagus/src/action/action_resource.c
diff -u stratagus/src/action/action_resource.c:1.49
stratagus/src/action/action_resource.c:1.50
--- stratagus/src/action/action_resource.c:1.49 Sun Aug 24 14:48:03 2003
+++ stratagus/src/action/action_resource.c Thu Aug 28 18:51:41 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_resource.c,v 1.49 2003/08/24 18:48:03 n0body Exp $
+// $Id: action_resource.c,v 1.50 2003/08/28 22:51:41 n0body Exp $
//@{
@@ -129,6 +129,15 @@
// FIXME: 0 can happen, if to near placed by map designer.
DebugCheck( MapDistanceToUnit(unit->X,unit->Y,goal)>1 );
+
+ //
+ // Update the heading of a harvesting unit to looks straight at the
resource.
+ //
+ if (goal) {
+ UnitHeadingFromDeltaXY(unit,
+ 2*(goal->X-unit->X)+goal->Type->TileWidth,
+ 2*(goal->Y-unit->Y)+goal->Type->TileHeight);
+ }
//
// If resource is still under construction, wait!
@@ -147,11 +156,6 @@
return 0;
}
- RefsDebugCheck( !goal->Refs );
- --goal->Refs;
- RefsDebugCheck( !goal->Refs );
- unit->Orders[0].Goal=NoUnitP;
-
// Activate the resource
goal->Data.Resource.Active++;
@@ -159,14 +163,22 @@
//
// Place unit inside the resource
//
- RemoveUnit(unit,goal);
- unit->X=goal->X;
- unit->Y=goal->Y;
+ if (!unit->Type->HarvestFromOutside) {
+
+ RefsDebugCheck( !goal->Refs );
+ --goal->Refs;
+ RefsDebugCheck( !goal->Refs );
+ unit->Orders[0].Goal=NoUnitP;
+
+ RemoveUnit(unit,goal);
+ unit->X=goal->X;
+ unit->Y=goal->Y;
+ }
if (unit->Type->WaitAtResource) {
- unit->Wait=unit->Type->WaitAtResource;
+ unit->Data.ResWorker.TimeToHarvest=unit->Type->WaitAtResource;
} else {
- unit->Wait=1;
+ unit->Data.ResWorker.TimeToHarvest=1;
}
unit->Reset=1;
@@ -174,6 +186,26 @@
return 1;
}
+
+local void AnimateActionHarvest(Unit* unit)
+{
+ int flags;
+ if( unit->Type->Animations ) {
+ //FIXME: Animation->Harvest
+ DebugCheck( !unit->Type->Animations->Attack );
+ flags=UnitShowAnimation(unit,unit->Type->Animations->Attack);
+#ifdef WITH_SOUND
+ if( (flags&AnimationSound) ) {
+ if( GameSounds.Repair.Sound==(void*)-1 ) {
+ PlayUnitSound(unit,VoiceAttacking);
+ } else {
+ PlayUnitSound(unit,VoiceRepair);
+ }
+ }
+#endif
+ }
+}
+
/**
** Wait in resource, for collecting the resource.
**
@@ -187,42 +219,87 @@
Unit* depot;
Unit* uins;
int i;
+ int addload;
- source=unit->Container;
-
- DebugCheck( !source );
- DebugCheck( source->Value>655350 );
-
- // Update the resource quantity. FIXME: depleted resources.
- if (source->Value<unit->Type->ResourceCapacity) {
- // Uhh-oh, depleted.
- unit->Value=source->Value;
- source->Value=0;
+ if (unit->Type->HarvestFromOutside) {
+ AnimateActionHarvest(unit);
} else {
- // Remove resources.
- unit->Value=unit->Type->ResourceCapacity;
- source->Value-=unit->Type->ResourceCapacity;
+ unit->Wait=1;
}
-
- UnitMarkSeen(source);
- if( IsOnlySelected(source) ) {
- MustRedraw|=RedrawInfoPanel;
+
+ // This means we have to return.
+ if (unit->Data.ResWorker.TimeToHarvest==-1) {
+ DebugCheck(!unit->Type->HarvestFromOutside);
+ return unit->Reset;
}
- // Change unit to full state.
- if( unit->Type->TransformWhenLoaded&&unit->Value ) {
- unit->Player->UnitTypesCount[unit->Type->Type]--;
- unit->Type=unit->Type->TransformWhenLoaded;
- unit->Player->UnitTypesCount[unit->Type->Type]++;
+ if (--unit->Data.ResWorker.TimeToHarvest) {
+ DebugLevel3Fn("need to wait %d more cycles.\n" _C_
unit->Data.ResWorker.TimeToHarvest);
+ return 0;
}
+
+ unit->Data.ResWorker.TimeToHarvest=unit->Type->WaitAtResource;
+
+ if ( unit->Type->HarvestFromOutside ) {
+ source=unit->Orders[0].Goal;
+ } else {
+ source=unit->Container;
+ }
+
+ DebugCheck( !source );
+ DebugCheck( source->Value>655350 );
//
+ // Target is dead, stop getting resources.
+ //
+ if( !(source->Destroyed || source->Removed || !source->HP ||
+ source->Orders[0].Action==UnitActionDie)) {
+ //
+ // Calculate how much we can load.
+ //
+ if (unit->Type->ResourceStep) {
+ addload = unit->Type->ResourceStep;
+ } else {
+ addload = unit->Type->ResourceCapacity;
+ }
+ // Don't load more that there is.
+ if (addload > source->Value) {
+ addload = source->Value;
+ }
+ // Make sure we don't bite more than we can chew.
+ if (unit->Value + addload > unit->Type->ResourceCapacity) {
+ addload = unit->Type->ResourceCapacity - unit->Value;
+ }
+
+ DebugLevel3Fn("Harvested another %d resources.\n" _C_ addload);
+
+ unit->Value += addload;
+ source->Value -= addload;
+
+ UnitMarkSeen(source);
+ if( IsOnlySelected(source) ) {
+ MustRedraw|=RedrawInfoPanel;
+ }
+ // Change unit to full state.
+ if( unit->Type->TransformWhenLoaded&&unit->Value ) {
+ unit->Player->UnitTypesCount[unit->Type->Type]--;
+ unit->Type=unit->Type->TransformWhenLoaded;
+ unit->Player->UnitTypesCount[unit->Type->Type]++;
+ }
+ }
+
+ //
// End of resource: destroy the resource.
+ // FIXME: implement depleted resources.
//
- if( source->Value==0 ) {
- DebugLevel0Fn("%lu: Resource is destroyed\n" _C_ GameCycle);
+ if( source->Destroyed || source->Removed || !source->HP ||
+ source->Orders[0].Action==UnitActionDie || source->Value==0) {
+ DebugLevel0Fn("Resource is destroyed\n");
uins=source->UnitInside;
- // Improved version of DropOutAll
+ //
+ // Improved version of DropOutAll that makes workers go to the depot.
+ // FIXME: empty harvesters whould find another resource.
+ //
for( i=source->InsideCount; i; --i,uins=uins->NextContained ) {
if (uins->Value &&
(depot=FindDeposit(uins->Player,uins->X,uins->Y,source->Type->GivesResource))) {
DropOutNearest(uins,depot->X+depot->Type->TileWidth/2
@@ -248,19 +325,26 @@
uins->SubAction=0;
}
- LetUnitDie(source);
+ // Don't destroy the resource twice.
+ if( !(source->Destroyed || source->Removed || !source->HP ||
+ source->Orders[0].Action==UnitActionDie)){
+ LetUnitDie(source);
+ }
// FIXME: make the workers inside look for a new resource.
source=NULL;
}
- /*CheckUnitToBeDrawn(unit);
- if( IsOnlySelected(unit) ) {
- SelectedUnitChanged();
- // FIXME: redundant?
- MustRedraw|=RedrawButtonPanel;
- }*/
-
- return 1;
+ // Only return home if we are full.
+ if (unit->Value < unit->Type->ResourceCapacity || !source) {
+ return 0;
+ } else {
+ if (unit->Type->HarvestFromOutside) {
+ unit->Data.ResWorker.TimeToHarvest=-1;
+ return 0;
+ } else {
+ return 1;
+ }
+ }
}
/**
@@ -275,12 +359,16 @@
Unit* depot;
Unit* source;
- if ((source=unit->Container)) {
- // Deactivate the resource. Wicked.
- source->Data.Resource.Active--;
- DebugCheck(source->Data.Resource.Active<0);
+
+ if ( unit->Type->HarvestFromOutside ) {
+ source=unit->Orders[0].Goal;
+ } else {
+ source=unit->Container;
}
+ source->Data.Resource.Active--;
+ DebugCheck(source->Data.Resource.Active<0);
+
// Store resource position.
// FIXME: is this the best way?
unit->Orders[0].Arg1=(void*)((unit->X<<16)|unit->Y);
@@ -288,7 +376,8 @@
// Find and send to resource deposit.
if(
(!(depot=FindDeposit(unit->Player,unit->X,unit->Y,unit->Type->ResourceHarvested)))
|| (!unit->Value)) {
- if (source) {
+ if (!unit->Type->HarvestFromOutside) {
+ DebugCheck(!unit->Container);
DropOutOnSide(unit,LookingW,source->Type->TileWidth,source->Type->TileHeight);
}
DebugLevel0Fn("Can't find a resource deposit.\n");
@@ -296,7 +385,8 @@
unit->SubAction=0;
// should return 0, done below!
} else {
- if (source) {
+ if (!unit->Type->HarvestFromOutside) {
+ DebugCheck(!unit->Container);
DropOutNearest(unit,depot->X+depot->Type->TileWidth/2
,depot->Y+depot->Type->TileHeight/2
,source->Type->TileWidth,source->Type->TileHeight);
@@ -464,7 +554,6 @@
++goal->Refs;
unit->Orders[0].RangeX=unit->Orders[0].RangeY=1;
unit->Orders[0].X=unit->Orders[0].Y=-1;
- NewResetPath(unit);
}
CheckUnitToBeDrawn(unit);
@@ -479,8 +568,11 @@
*/
void ResourceGiveUp(Unit* unit)
{
+ DebugLevel0Fn("Unit %d gave up on resource gathering.\n" _C_ unit->Slot);
unit->Orders[0].Action=UnitActionStill;
unit->Wait=1;
+ unit->Reset=1;
+ unit->Orders[0].X=unit->Orders[0].Y=-1;
unit->SubAction=0;
if( unit->Orders[0].Goal ) {
RefsDebugCheck( !unit->Orders[0].Goal->Refs );
@@ -507,7 +599,8 @@
// Let's start mining.
if ( unit->SubAction==SUB_START_RESOURCE ) {
NewResetPath(unit);
- unit->SubAction=1;
+ DebugLevel3Fn("Started mining. reset path.\n");
+ unit->SubAction=SUB_MOVE_TO_RESOURCE;
}
// Move to the resource location.
@@ -531,8 +624,8 @@
// Resource seems to be unreachable
if (unit->SubAction==SUB_UNREACHABLE_RESOURCE) {
- return;
ResourceGiveUp(unit);
+ return;
}
// Start gathering the resource
@@ -547,6 +640,8 @@
if (unit->SubAction==SUB_GATHER_RESOURCE) {
if( GatherResource(unit) ) {
unit->SubAction=SUB_STOP_GATHERING;
+ } else {
+ return;
}
}
Index: stratagus/src/action/actions.c
diff -u stratagus/src/action/actions.c:1.88 stratagus/src/action/actions.c:1.89
--- stratagus/src/action/actions.c:1.88 Sun Aug 24 14:48:03 2003
+++ stratagus/src/action/actions.c Thu Aug 28 18:51:41 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: actions.c,v 1.88 2003/08/24 18:48:03 n0body Exp $
+// $Id: actions.c,v 1.89 2003/08/28 22:51:41 n0body Exp $
//@{
@@ -292,7 +292,14 @@
// Release pending references.
//
if( unit->Orders[0].Goal ) {
- // Still shouldn't have a reference
+ // If mining decrease the active count on the resource.
+ if ( unit->Orders[0].Action==UnitActionResource &&
+ unit->SubAction==60) {
+ // FIXME: SUB_GATHER_RESOURCE ?
+ unit->Orders[0].Goal->Data.Resource.Active--;
+ DebugCheck(unit->Orders[0].Goal->Data.Resource.Active<0);
+ }
+ // Still shouldn't have a reference
DebugCheck( unit->Orders[0].Action==UnitActionStill );
RefsDebugCheck( !unit->Orders[0].Goal->Refs );
if( !--unit->Orders[0].Goal->Refs ) {
Index: stratagus/src/ai/ai_building.c
diff -u stratagus/src/ai/ai_building.c:1.36 stratagus/src/ai/ai_building.c:1.37
--- stratagus/src/ai/ai_building.c:1.36 Sun Aug 24 14:48:03 2003
+++ stratagus/src/ai/ai_building.c Thu Aug 28 18:51:41 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ai_building.c,v 1.36 2003/08/24 18:48:03 n0body Exp $
+// $Id: ai_building.c,v 1.37 2003/08/28 22:51:41 n0body Exp $
#ifdef NEW_AI // {
@@ -630,9 +630,9 @@
//
// Find a good place for a new hall
//
- DebugLevel3Fn("building is a %s(%s)\n" _C_ type->Ident _C_ type->Name);
+ DebugLevel0Fn("Wanty to build a %s(%s)\n" _C_ type->Ident _C_ type->Name);
if( type->CanStore[GoldCost] && AiFindHallPlace(worker,type,dx,dy) ) {
- DebugLevel3Fn("found for town hall (%s,%s)\n" _C_ type->Ident _C_
type->Name);
+ DebugLevel0Fn("Found place for town hall (%s,%s)\n" _C_ type->Ident _C_
type->Name);
return 1;
}
Index: stratagus/src/clone/unit_draw.c
diff -u stratagus/src/clone/unit_draw.c:1.155
stratagus/src/clone/unit_draw.c:1.156
--- stratagus/src/clone/unit_draw.c:1.155 Mon Aug 25 07:21:17 2003
+++ stratagus/src/clone/unit_draw.c Thu Aug 28 18:51:41 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit_draw.c,v 1.155 2003/08/25 11:21:17 mr-russ Exp $
+// $Id: unit_draw.c,v 1.156 2003/08/28 22:51:41 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.155 2003/08/25
11:21:17 mr-russ Exp $\n\n");
+ CLprintf(file,";;; MODULE: decorations $Id: unit_draw.c,v 1.156 2003/08/28
22:51:41 n0body Exp $\n\n");
CLprintf(file,"(mana-sprite \"%s\" %d %d %d %d)\n",
ManaSprite.File,ManaSprite.HotX,ManaSprite.HotY,
@@ -1530,7 +1530,7 @@
**
** @param unit Pointer to the unit.
*/
-local void ShowOrder(const Unit* unit)
+global void ShowOrder(const Unit* unit)
{
int x1;
int y1;
Index: stratagus/src/include/unit.h
diff -u stratagus/src/include/unit.h:1.209 stratagus/src/include/unit.h:1.210
--- stratagus/src/include/unit.h:1.209 Mon Aug 25 07:21:17 2003
+++ stratagus/src/include/unit.h Thu Aug 28 18:51:42 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.h,v 1.209 2003/08/25 11:21:17 mr-russ Exp $
+// $Id: unit.h,v 1.210 2003/08/28 22:51:42 n0body Exp $
#ifndef __UNIT_H__
#define __UNIT_H__
@@ -591,8 +591,11 @@
ConstructionFrame* Frame; /// Construction frame
} Builded; /// ActionBuilded,...
struct _order_resource_ {
- int Active; /// how much units are in the resource
+ int Active; /// how many units are harvesting from
the resource.
} Resource; /// Resource still
+ struct _order_resource_worker_ {
+ int TimeToHarvest; /// how much time until we harvest some
more.
+ } ResWorker; /// Worker harvesting
struct _order_research_ {
Upgrade* Upgrade; /// Upgrade researched
} Research; /// Research action
@@ -933,6 +936,8 @@
extern void DrawBuilding(const Unit* unit);
/// Draw all units visible on map in viewport
extern int FindAndSortUnits(const Viewport* vp, Unit** table);
+ /// Show an unit's orders.
+extern void ShowOrder(const Unit* unit);
// in unit_find.c
/// Select units in rectangle range
Index: stratagus/src/include/unittype.h
diff -u stratagus/src/include/unittype.h:1.99
stratagus/src/include/unittype.h:1.100
--- stratagus/src/include/unittype.h:1.99 Sun Aug 24 14:48:03 2003
+++ stratagus/src/include/unittype.h Thu Aug 28 18:51:42 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unittype.h,v 1.99 2003/08/24 18:48:03 n0body Exp $
+// $Id: unittype.h,v 1.100 2003/08/28 22:51:42 n0body Exp $
#ifndef __UNITTYPE_H__
#define __UNITTYPE_H__
@@ -320,6 +320,11 @@
**
** Unit is a resource worker.
**
+** UnitType::HarvestFromOutside
+**
+** Unit will harvest from the outside. The unit will use it's
+** Attack animation (seems it turned into a generic Action anim.)
+**
** UnitType::ResourceHarvested
**
** The resource it can harvest. Needs Harvester flag. An unit
@@ -390,11 +395,14 @@
**
** UnitType::CanAttack
**
-** FIXME: docu
+** Unit is able to attack.
**
** UnitType::CanRepair
**
-** Unit can repair buildings.
+** 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.
**
** UnitType::BuilderOutside
**
@@ -417,6 +425,7 @@
** UnitType::Hero
**
** FIXME: Unit is a hero. Where is this used?
+** FIXME: I don't think w*rcr*ft 2 exp heroes have this flag.
** In st*rcr*ft heroes seem to be imune to spawn broodlings,
** maybe we could use it in the same way. Spawn broodlings is
** an instant kill for many units.
@@ -449,7 +458,7 @@
**
** UnitType::Supply
**
-** Food supply
+** How much food does this unit supply.
**
** UnitType::Demand
**
@@ -482,6 +491,7 @@
** UnitType::Property
**
** CCL property storage
+** FIXME: how is this used at runtime?
**
** UnitType::Sprite
**
@@ -670,6 +680,7 @@
unsigned MaxWorkers; /// Maximum number of workers.
unsigned CanHarvest : 1; /// Resource can be harvested.
unsigned Harvester : 1; /// Unit is a resource worker.
+ unsigned HarvestFromOutside; /// Unit harvests without entering the
building.
unsigned ResourceHarvested; /// The resource it can harvest.
unsigned WaitAtResource; /// Cycles the unit waits while mining.
unsigned ResourceStep; /// Resources the unit gains per mining
cycle.
Index: stratagus/src/pathfinder/astar.c
diff -u stratagus/src/pathfinder/astar.c:1.47
stratagus/src/pathfinder/astar.c:1.48
--- stratagus/src/pathfinder/astar.c:1.47 Thu Aug 28 08:25:42 2003
+++ stratagus/src/pathfinder/astar.c Thu Aug 28 18:51:42 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: astar.c,v 1.47 2003/08/28 12:25:42 mr-russ Exp $
+// $Id: astar.c,v 1.48 2003/08/28 22:51:42 n0body Exp $
//@{
@@ -694,7 +694,7 @@
// let's clean up the matrix now
AStarCleanUp(num_in_close);
- DebugLevel1Fn("Tiles Visited: %d\n" _C_
(TheMap.Height*TheMap.Width)-counter);
+ DebugLevel3Fn("Tiles Visited: %d\n" _C_
(TheMap.Height*TheMap.Width)-counter);
return path_length;
}
Index: stratagus/src/ui/mainscr.c
diff -u stratagus/src/ui/mainscr.c:1.118 stratagus/src/ui/mainscr.c:1.119
--- stratagus/src/ui/mainscr.c:1.118 Sun Aug 24 14:48:03 2003
+++ stratagus/src/ui/mainscr.c Thu Aug 28 18:51:42 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: mainscr.c,v 1.118 2003/08/24 18:48:03 n0body Exp $
+// $Id: mainscr.c,v 1.119 2003/08/28 22:51:42 n0body Exp $
//@{
@@ -1189,6 +1189,9 @@
if( NumSelected ) {
if( NumSelected>1 ) {
+ //
+ // If there are more units selected draw their pictures and a
health bar
+ //
PlayerPixels(ThisPlayer); // can only be own!
DrawInfoPanelBackground(0);
for( i=0; i<NumSelected; ++i ) {
Index: stratagus/src/unit/ccl_unittype.c
diff -u stratagus/src/unit/ccl_unittype.c:1.76
stratagus/src/unit/ccl_unittype.c:1.77
--- stratagus/src/unit/ccl_unittype.c:1.76 Sun Aug 24 14:48:04 2003
+++ stratagus/src/unit/ccl_unittype.c Thu Aug 28 18:51:42 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ccl_unittype.c,v 1.76 2003/08/24 18:48:04 n0body Exp $
+// $Id: ccl_unittype.c,v 1.77 2003/08/28 22:51:42 n0body Exp $
//@{
@@ -404,6 +404,11 @@
type->Coward=1;
} else if( gh_eq_p(value,gh_symbol2scm("harvester")) ) {
type->Harvester=1;
+ } else if( gh_eq_p(value,gh_symbol2scm("harvest-from-outside")) ) {
+ type->HarvestFromOutside=1;
+ } else if( gh_eq_p(value,gh_symbol2scm("resource-step")) ) {
+ type->ResourceStep=gh_scm2int(gh_car(list));
+ list=gh_cdr(list);
} else if( gh_eq_p(value,gh_symbol2scm("resource-harvested")) ) {
type->ResourceHarvested=CclGetResourceByName(gh_car(list));
list=gh_cdr(list);
Index: stratagus/src/unit/unittype.c
diff -u stratagus/src/unit/unittype.c:1.88 stratagus/src/unit/unittype.c:1.89
--- stratagus/src/unit/unittype.c:1.88 Sun Aug 24 14:48:04 2003
+++ stratagus/src/unit/unittype.c Thu Aug 28 18:51:42 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unittype.c,v 1.88 2003/08/24 18:48:04 n0body Exp $
+// $Id: unittype.c,v 1.89 2003/08/28 22:51:42 n0body Exp $
//@{
@@ -887,7 +887,10 @@
CLprintf(file," 'coward\n");
}
if( type->Harvester ) {
- CLprintf(file," 'harvester 'resource-harvested
'%s",DefaultResourceNames[type->ResourceHarvested]);
+ CLprintf(file," 'harvester 'resource-harvested
'%s\n",DefaultResourceNames[type->ResourceHarvested]);
+ }
+ if( type->HarvestFromOutside ) {
+ CLprintf(file," 'harvest-from-outside\n");
}
if ( type->WaitAtResource ) {
CLprintf(file," 'wait-at-resource %d\n",type->WaitAtResource);
@@ -908,7 +911,10 @@
CLprintf(file," 'gives-resource
'%s\n",DefaultResourceNames[type->GivesResource]);
}
if( type->MaxWorkers ) {
- CLprintf(file," 'max-workers '%d\n",type->MaxWorkers);
+ CLprintf(file," 'max-workers %d\n",type->MaxWorkers);
+ }
+ if( type->ResourceStep ){
+ CLprintf(file," 'resource-step %d\n",type->ResourceStep);
}
// Save store info.
@@ -1034,7 +1040,7 @@
char **sp;
CLprintf(file,"\n;;; -----------------------------------------\n");
- CLprintf(file,";;; MODULE: unittypes $Id: unittype.c,v 1.88 2003/08/24
18:48:04 n0body Exp $\n\n");
+ CLprintf(file,";;; MODULE: unittypes $Id: unittype.c,v 1.89 2003/08/28
22:51:42 n0body Exp $\n\n");
// Original number to internal unit-type name.