[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src action/action_build.c action/acti...
From: |
address@hidden |
Subject: |
[Stratagus-CVS] stratagus/src action/action_build.c action/acti... |
Date: |
28 Jan 2004 07:54:48 +1100 |
CVSROOT: /home/strat
Module name: stratagus
Changes by: <address@hidden> 04/01/28 07:54:47
Modified files:
src/action : action_build.c action_die.c action_repair.c
action_still.c actions.c command.c
src/unit : unit.c
Log message:
Fixed UnitType::Stats
Patches:
Index: stratagus/src/action/action_build.c
diff -u stratagus/src/action/action_build.c:1.110
stratagus/src/action/action_build.c:1.111
--- stratagus/src/action/action_build.c:1.110 Wed Jan 21 05:41:57 2004
+++ stratagus/src/action/action_build.c Wed Jan 28 07:54:44 2004
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_build.c,v 1.110 2004/01/20 18:41:57 nobody_ Exp $
+// $Id: action_build.c,v 1.111 2004/01/27 20:54:44 jsalmon3 Exp $
//@{
@@ -64,10 +64,8 @@
ConstructionFrame* tmp;
int percent;
-#if 0
- percent = unit->Data.Builded.Progress * 100 /
(unit->Type->Stats->Costs[TimeCost] * 600);
-#endif
- percent = unit->Data.Builded.Progress /
(unit->Type->Stats->Costs[TimeCost] * 6);
+ percent = unit->Data.Builded.Progress /
+ (unit->Type->Stats[unit->Player->Player].Costs[TimeCost] * 6);
cframe = tmp = unit->Type->Construction->Frames;
while (tmp) {
if (percent < tmp->Percent) {
@@ -296,7 +294,7 @@
// n is the current damage taken by the unit.
n = (unit->Data.Builded.Progress * unit->Stats->HitPoints) /
- (type->Stats->Costs[TimeCost] * 600) - unit->HP;
+ (type->Stats[unit->Player->Player].Costs[TimeCost] * 600) -
unit->HP;
// This below is most often 0
if (type->BuilderOutside) {
progress = unit->Type->AutoBuildRate;
@@ -310,7 +308,7 @@
unit->Data.Builded.Progress += progress;
// Keep the same level of damage while increasing HP.
unit->HP = (unit->Data.Builded.Progress * unit->Stats->HitPoints) /
- (type->Stats->Costs[TimeCost] * 600) - n;
+ (type->Stats[unit->Player->Player].Costs[TimeCost] * 600) - n;
if (unit->HP > unit->Stats->HitPoints) {
unit->HP = unit->Stats->HitPoints;
}
Index: stratagus/src/action/action_die.c
diff -u stratagus/src/action/action_die.c:1.58
stratagus/src/action/action_die.c:1.59
--- stratagus/src/action/action_die.c:1.58 Sat Jan 17 14:40:03 2004
+++ stratagus/src/action/action_die.c Wed Jan 28 07:54:44 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_die.c,v 1.58 2004/01/17 03:40:03 wizzard Exp $
+// $Id: action_die.c,v 1.59 2004/01/27 20:54:44 jsalmon3 Exp $
//@{
@@ -86,7 +86,7 @@
// Update sight for new corpse
MapUnmarkUnitSight(unit);
- unit->CurrentSightRange = unit->Type->Stats->SightRange;
+ unit->CurrentSightRange =
unit->Type->Stats[unit->Player->Player].SightRange;
MapMarkUnitSight(unit);
CommandStopUnit(unit); // This clears all
order queues
Index: stratagus/src/action/action_repair.c
diff -u stratagus/src/action/action_repair.c:1.64
stratagus/src/action/action_repair.c:1.65
--- stratagus/src/action/action_repair.c:1.64 Thu Jan 15 09:31:01 2004
+++ stratagus/src/action/action_repair.c Wed Jan 28 07:54:44 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_repair.c,v 1.64 2004/01/14 22:31:01 nobody_ Exp $
+// $Id: action_repair.c,v 1.65 2004/01/27 20:54:44 jsalmon3 Exp $
//@{
@@ -128,7 +128,7 @@
} else {
// hp is the current damage taken by the unit.
hp = (goal->Data.Builded.Progress * goal->Stats->HitPoints) /
- (goal->Type->Stats->Costs[TimeCost] * 600) - goal->HP;
+
(goal->Type->Stats[goal->Player->Player].Costs[TimeCost] * 600) - goal->HP;
//
// Calculate the length of the attack (repair) anim.
//
@@ -145,7 +145,7 @@
goal->Data.Builded.Progress += 100 * animlength * SpeedBuild;
// Keep the same level of damage while increasing HP.
goal->HP = (goal->Data.Builded.Progress *
goal->Stats->HitPoints) /
- (goal->Type->Stats->Costs[TimeCost] * 600) - hp;
+
(goal->Type->Stats[goal->Player->Player].Costs[TimeCost] * 600) - hp;
if (goal->HP > goal->Stats->HitPoints) {
goal->HP = goal->Stats->HitPoints;
}
@@ -225,7 +225,7 @@
// Have reached target? FIXME: could use return
value
//
if (goal && MapDistanceBetweenUnits(unit, goal)
<= unit->Type->RepairRange &&
- goal->HP <
goal->Type->Stats->HitPoints) {
+ goal->HP <
goal->Type->Stats[goal->Player->Player].HitPoints) {
unit->State = 0;
unit->SubAction = 2;
unit->Reset = 1;
Index: stratagus/src/action/action_still.c
diff -u stratagus/src/action/action_still.c:1.81
stratagus/src/action/action_still.c:1.82
--- stratagus/src/action/action_still.c:1.81 Fri Jan 23 05:12:21 2004
+++ stratagus/src/action/action_still.c Wed Jan 28 07:54:45 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: action_still.c,v 1.81 2004/01/22 18:12:21 nobody_ Exp $
+// $Id: action_still.c,v 1.82 2004/01/27 20:54:45 jsalmon3 Exp $
//@{
@@ -221,7 +221,7 @@
unit->Reset = 0;
unit->State = 0;
unit->SubAction = 1; // Mark attacking.
- if (type->Stats->Speed) {
+ if (type->Stats[unit->Player->Player].Speed) {
UnitHeadingFromDeltaXY(unit,
goal->X +
(goal->Type->TileWidth - 1) / 2 - unit->X,
goal->Y +
(goal->Type->TileHeight - 1) / 2 - unit->Y);
Index: stratagus/src/action/actions.c
diff -u stratagus/src/action/actions.c:1.114
stratagus/src/action/actions.c:1.115
--- stratagus/src/action/actions.c:1.114 Sat Jan 17 18:26:07 2004
+++ stratagus/src/action/actions.c Wed Jan 28 07:54:45 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: actions.c,v 1.114 2004/01/17 07:26:07 jsalmon3 Exp $
+// $Id: actions.c,v 1.115 2004/01/27 20:54:45 jsalmon3 Exp $
//@{
@@ -566,7 +566,7 @@
HandleUnitAction(unit);
DebugCheck(*tpos != unit); // Removed is evil.
-#ifdef DEBUG_ACTIONS
+#if 1
//
// Dump the unit to find the network sync bugs.
//
Index: stratagus/src/action/command.c
diff -u stratagus/src/action/command.c:1.131
stratagus/src/action/command.c:1.132
--- stratagus/src/action/command.c:1.131 Sat Jan 24 03:00:50 2004
+++ stratagus/src/action/command.c Wed Jan 28 07:54:45 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: command.c,v 1.131 2004/01/23 16:00:50 nobody_ Exp $
+// $Id: command.c,v 1.132 2004/01/27 20:54:45 jsalmon3 Exp $
//@{
@@ -1036,7 +1036,7 @@
if (unit->Orders[0].Action == UnitActionUpgradeTo) {
PlayerAddCostsFactor(unit->Player,
- unit->Orders[0].Type->Stats->Costs,
+ unit->Orders[0].Type->Stats[unit->Player->Player].Costs,
CancelUpgradeCostsFactor);
unit->Orders[0].Action = UnitActionStill;
Index: stratagus/src/unit/unit.c
diff -u stratagus/src/unit/unit.c:1.376 stratagus/src/unit/unit.c:1.377
--- stratagus/src/unit/unit.c:1.376 Sun Jan 25 16:51:45 2004
+++ stratagus/src/unit/unit.c Wed Jan 28 07:54:46 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.c,v 1.376 2004/01/25 05:51:45 wizzard Exp $
+// $Id: unit.c,v 1.377 2004/01/27 20:54:46 jsalmon3 Exp $
//@{
@@ -2857,7 +2857,7 @@
!unit->Type->Animations->Die);
UnitShowAnimation(unit, unit->Type->Animations->Die);
DebugLevel0Fn("Frame %d\n" _C_ unit->Frame);
- unit->CurrentSightRange = type->Stats->SightRange;
+ unit->CurrentSightRange =
type->Stats[unit->Player->Player].SightRange;
MapMarkUnitSight(unit);
} else {
// no corpse available
@@ -2890,7 +2890,7 @@
unit->Orders[0].Action = UnitActionDie;
if (unit->Type->CorpseType) {
- unit->CurrentSightRange =
unit->Type->CorpseType->Stats->SightRange;
+ unit->CurrentSightRange =
unit->Type->CorpseType->Stats[unit->Player->Player].SightRange;
} else {
unit->CurrentSightRange = 0;
}
@@ -3770,7 +3770,7 @@
int j;
CLprintf(file, "\n--- -----------------------------------------\n");
- CLprintf(file, "--- MODULE: units $Id: unit.c,v 1.376 2004/01/25
05:51:45 wizzard Exp $\n\n");
+ CLprintf(file, "--- MODULE: units $Id: unit.c,v 1.377 2004/01/27
20:54:46 jsalmon3 Exp $\n\n");
#if 0
//