[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus doc/script/missiletypes.html doc/scri...
From: |
address@hidden |
Subject: |
[Stratagus-CVS] stratagus doc/script/missiletypes.html doc/scri... |
Date: |
2 Feb 2004 10:12:32 +1100 |
CVSROOT: /home/strat
Module name: stratagus
Changes by: <address@hidden> 04/02/02 10:12:31
Modified files:
doc/script : missiletypes.html script-index.html script.html
stratagus.html
src/include : stratagus.h
src/stratagus : spells.c
src/unit : unit_cache.c
Log message:
Fix polymorph. Some more doc work.
Patches:
Index: stratagus/doc/script/missiletypes.html
diff -u stratagus/doc/script/missiletypes.html:1.1
stratagus/doc/script/missiletypes.html:1.2
--- stratagus/doc/script/missiletypes.html:1.1 Mon Feb 2 06:00:22 2004
+++ stratagus/doc/script/missiletypes.html Mon Feb 2 10:12:28 2004
@@ -34,113 +34,29 @@
<a href="script-index.html">Script index</a>
<hr>
<a href="stratagus.html">Stratagus.*</a>
+ <a href="missiletypes.html">Stratagus.MissileTypes.*</a>
+ <a href="players.html">Stratagus.Players.*</a>
<hr>
<dl>
<!-- SCRIPT -->
- <a name="Stratagus.MissileTypes[].Ident">
- <dt><b>Stratagus.MissileTypes[].Ident</b></dt>
- <dd><b>Type:</b> string </dd>
- <dd>The missile type's name. By tradition you should use
something like
- "missile-small-arrow". Read-only.</dd>
- <a name="Stratagus.MissileTypes[].File">
- <dt><b>Stratagus.MissileTypes[].File</b></dt>
- <dd><b>Type:</b> string (filename) </dd>
- <dd>Filename with missile graphics. Relative to
- <a
href="stratagus.html#Stratagus.LibraryFilePath">Stratagus.LibaryFilePath</a></dd>
- <a name="Stratagus.MissileTypes[].Transparency">
- <dt><b>Stratagus.MissileTypes[].Transparency</b></dt>
- <dd><b>Type:</b> int (byte) </dd>
- <dd>This is the transparency value for the missile. Value
should be between
- 0(completely transparent) and 256(completely opaque).
NOT TESTED</dd>
- <a name="Stratagus.MissileTypes[].Width">
- <dt><b>Stratagus.MissileTypes[].Width</b></dt>
- <dd><b>Type:</b> int </dd>
- <dd>This is the width of one frame in the graphic file.</dd>
- <a name="Stratagus.MissileTypes[].Height">
- <dt><b>Stratagus.MissileTypes[].Height</b></dt>
- <dd><b>Type:</b> int </dd>
- <dd>This is the height of one frame in the graphic
file.</dd>
- <a name="Stratagus.MissileTypes[].DrawLevel">
- <dt><b>Stratagus.MissileTypes[].DrawLevel</b></dt>
- <dd><b>Type:</b> int </dd>
- <dd>Drawing level. Missiles and units are sorted by this
value. We need to
- add details on the actual implementation of the
sort.</dd>
- <a name="Stratagus.MissileTypes[].SpriteFrames">
- <dt><b>Stratagus.MissileTypes[].SpriteFrames</b></dt>
- <dd><b>Type:</b> int </dd>
- <dd>The number of the frames for this sprite. Missile
animation is trivial,
- It will go through the Sprite frames in order</dd>
- <a name="Stratagus.MissileTypes[].NumDirections">
- <dt><b>Stratagus.MissileTypes[].NumDirections</b></dt>
- <dd><b>Type:</b> int </dd>
- <dd>The number of the directions for the missile. Inside
the graphic file
- sprites are arranged first by frame then by direction.
Line x is for frame
- x, column y for dirrection y. Directions are considered
to be equally spaced.</dd>
- <a name="Stratagus.MissileTypes[].NumBounces">
- <dt><b>Stratagus.MissileTypes[].NumBounces</b></dt>
- <dd><b>Type:</b> int </dd>
- <dd>You can make missiles bounce, the obvious example is
fireballs in warcraft 2.
- After hitting it's destination point, the missile will
"bounce" and keep going
- hitting "NumBounces" times every tile and a
half(haredcoded, sorry)</dd>
- <a name="Stratagus.MissileTypes[].Sleep">
- <dt><b>Stratagus.MissileTypes[].Sleep</b></dt>
- <dd><b>Type:</b> int </dd>
- <dd>This are the number of game cycles to wait between
two animation steps.
- All animation steps are equally spaced.</dd>
- <a name="Stratagus.MissileTypes[].Speed">
- <dt><b>Stratagus.MissileTypes[].Speed</b></dt>
- <dd><b>Type:</b> int </dd>
- <dd>This is the number of pixels the missile moves for
every animation frame.</dd>
- <a name="Stratagus.MissileTypes[].Range">
- <dt><b>Stratagus.MissileTypes[].Range</b></dt>
- <dd><b>Type:</b> int </dd>
- <dd>This is <b>NOT</b> the maximum range you can fire
the missile at. It's the
- range for splash damage. 0 affects a single unit,
otherwise it's the number of
- tiles around the hit that get affected.</dd>
- <a name="Stratagus.MissileTypes[].SplashFactor">
- <dt><b>Stratagus.MissileTypes[].SplashFactor</b></dt>
- <dd><b>Type:</b> int </dd>
- <dd>This is the factor for splash damage. The first
tile gets full damage,
- a tile x away from the center get damage / (x *
SplashFactor)</dd>
+ <a name="Stratagus.MissileTypes">
+ <dt><b>Stratagus.MissileTypes</b></dt>
+ <dd><b>Type:</b> missile collection </dd>
+ <dd>This is the collection of missile types. every
missile type has a name,
+ generally prefixed with "missile-". You have to use
.Create to create a new
+ missile type.</dd>
<a name="Stratagus.MissileTypes[].CanHitOwner">
<dt><b>Stratagus.MissileTypes[].CanHitOwner</b></dt>
<dd><b>Type:</b> boolean </dd>
<dd>This is true if the missile can hit it's owner
(unit that fired it most
of the time) or false otherwise. Do not confuse this
with
<a
href="missiletypes.html#Stratagus.MissileTypes[].FriendlyFire">FriendlyFire</a></dd>
- <a name="Stratagus.MissileTypes[].FriendlyFire">
- <dt><b>Stratagus.MissileTypes[].FriendlyFire</b></dt>
- <dd><b>Type:</b> boolean </dd>
- <dd>This is false if the missile can hit units that are
allied with the owner. This
- includes units of the missile's owner. It also makes
- <a
href="missiletypes.html#Stratagus.MissileTypes[].CanHitOwner">CanHitOwner</a>
- useless if it's false.</dd>
- <a name="Stratagus.MissileTypes[].ImpactMissile">
- <dt><b>Stratagus.MissileTypes[].ImpactMissile</b></dt>
- <dd><b>Type:</b> string, missile-ident </dd>
- <dd>This string is the name of a missile to be spawned
when the unit hits. It will
- spawn multiple times for
- <a
href="missiletypes.html#Stratagus.MissileTypes[].NumBounces">NumBounces</a>.
- Can also be nil, to disable it.
- <a name="Stratagus.MissileTypes[].SmokeMissile">
- <dt><b>Stratagus.MissileTypes[].SmokeMissile</b></dt>
- <dd><b>Type:</b> string, missile-ident </dd>
- <dd>This string is the name of a missile to be spawned
every "once in a while" as
- smoke. Can also be nil, to disable it. NOT TESTED</dd>
- <a name="Stratagus.MissileTypes[].FiredSound">
- <dt><b>Stratagus.MissileTypes[].FiredSound</b></dt>
- <dd><b>Type:</b> string, sound-ident </dd>
- <dd>Sound to be played when the missile is fired. Can
also be nil, to disable it.</dd>
- <a name="Stratagus.MissileTypes[].ImpactSound">
- <dt><b>Stratagus.MissileTypes[].ImpactSound</b></dt>
- <dd><b>Type:</b> string, sound-ident </dd>
- <dd>Sound to be played the missile hits it's target.
Can be nil to disable it.</dd>
- <a name="Stratagus.MissileType[].Class">
- <dt><b>Stratagus.MissileTypes[].CLass</b></dt>
+ <a name="Stratagus.MissileTypes[].Class">
+ <dt><b>Stratagus.MissileTypes[].Class</b></dt>
<dd><b>Type:</b> string, special values only </dd>
<dd>This is probably the most interesting part of the
MissileType. It can receive a
number of string values, that influence the exact
behaviour and trajectory of the
- missile when it is fired. Here is a list of possible
values. </dd>
+ missile when it is fired. Here is a list of possible
values.</dd>
<dl>
<dt><i>missile-class-none</i></dt>
<dd>Missile does nothing. Shouldn't
really be used.</dd>
@@ -179,9 +95,101 @@
<dd>Missile is death coil, will drain
health from target or enemy units
in the area and feed it to the
caster.<b>FIXME more configurable</b></dd>
</dl>
- <!-- SCRIPT -->
+ <a name="Stratagus.MissileTypes[].DrawLevel">
+ <dt><b>Stratagus.MissileTypes[].DrawLevel</b></dt>
+ <dd><b>Type:</b> int </dd>
+ <dd>Drawing level. Missiles and units are sorted by this
value. We need to
+ add details on the actual implementation of the
sort.</dd>
+ <a name="Stratagus.MissileTypes[].File">
+ <dt><b>Stratagus.MissileTypes[].File</b></dt>
+ <dd><b>Type:</b> string (filename) </dd>
+ <dd>Filename with missile graphics. Relative to
+ <a
href="stratagus.html#Stratagus.LibraryFilePath">Stratagus.LibaryFilePath</a></dd>
+ <a name="Stratagus.MissileTypes[].FiredSound">
+ <dt><b>Stratagus.MissileTypes[].FiredSound</b></dt>
+ <dd><b>Type:</b> string, sound-ident </dd>
+ <dd>Sound to be played when the missile is fired. Can
also be nil, to disable it.</dd>
+ <a name="Stratagus.MissileTypes[].FriendlyFire">
+ <dt><b>Stratagus.MissileTypes[].FriendlyFire</b></dt>
+ <dd><b>Type:</b> boolean </dd>
+ <dd>This is false if the missile can hit units that are
allied with the owner. This
+ includes units of the missile's owner. It also makes
+ <a
href="missiletypes.html#Stratagus.MissileTypes[].CanHitOwner">CanHitOwner</a>
+ useless if it's false.</dd>
+ <a name="Stratagus.MissileTypes[].Height">
+ <dt><b>Stratagus.MissileTypes[].Height</b></dt>
+ <dd><b>Type:</b> int </dd>
+ <dd>This is the height of one frame in the graphic
file.</dd>
+ <a name="Stratagus.MissileTypes[].Ident">
+ <dt><b>Stratagus.MissileTypes[].Ident</b></dt>
+ <dd><b>Type:</b> string </dd>
+ <dd>The missile type's name. By tradition you should use
something like
+ "missile-small-arrow". Read-only.</dd>
+ <a name="Stratagus.MissileTypes[].ImpactMissile">
+ <dt><b>Stratagus.MissileTypes[].ImpactMissile</b></dt>
+ <dd><b>Type:</b> string, missile-ident </dd>
+ <dd>This string is the name of a missile to be spawned
when the unit hits. It will
+ spawn multiple times for
+ <a
href="missiletypes.html#Stratagus.MissileTypes[].NumBounces">NumBounces</a>.
+ Can also be nil, to disable it.
+ <a name="Stratagus.MissileTypes[].ImpactSound">
+ <dt><b>Stratagus.MissileTypes[].ImpactSound</b></dt>
+ <dd><b>Type:</b> string, sound-ident </dd>
+ <dd>Sound to be played the missile hits it's target.
Can be nil to disable it.</dd>
+ <a name="Stratagus.MissileTypes[].NumBounces">
+ <dt><b>Stratagus.MissileTypes[].NumBounces</b></dt>
+ <dd><b>Type:</b> int </dd>
+ <dd>You can make missiles bounce, the obvious example is
fireballs in warcraft 2.
+ After hitting it's destination point, the missile will
"bounce" and keep going
+ hitting "NumBounces" times every tile and a
half(haredcoded, sorry)</dd>
+ <a name="Stratagus.MissileTypes[].NumDirections">
+ <dt><b>Stratagus.MissileTypes[].NumDirections</b></dt>
+ <dd><b>Type:</b> int </dd>
+ <dd>The number of the directions for the missile. Inside
the graphic file
+ sprites are arranged first by frame then by direction.
Line x is for frame
+ x, column y for dirrection y. Directions are considered
to be equally spaced.</dd>
+ <a name="Stratagus.MissileTypes[].Range">
+ <dt><b>Stratagus.MissileTypes[].Range</b></dt>
+ <dd><b>Type:</b> int </dd>
+ <dd>This is <b>NOT</b> the maximum range you can fire
the missile at. It's the
+ range for splash damage. 0 affects a single unit,
otherwise it's the number of
+ tiles around the hit that get affected.</dd>
+ <a name="Stratagus.MissileTypes[].Sleep">
+ <dt><b>Stratagus.MissileTypes[].Sleep</b></dt>
+ <dd><b>Type:</b> int </dd>
+ <dd>This are the number of game cycles to wait between
two animation steps.
+ All animation steps are equally spaced.</dd>
+ <a name="Stratagus.MissileTypes[].SmokeMissile">
+ <dt><b>Stratagus.MissileTypes[].SmokeMissile</b></dt>
+ <dd><b>Type:</b> string, missile-ident </dd>
+ <dd>This string is the name of a missile to be spawned
every "once in a while" as
+ smoke. Can also be nil, to disable it. NOT TESTED</dd>
+ <a name="Stratagus.MissileTypes[].Speed">
+ <dt><b>Stratagus.MissileTypes[].Speed</b></dt>
+ <dd><b>Type:</b> int </dd>
+ <dd>This is the number of pixels the missile moves for
every animation frame.</dd>
+ <a name="Stratagus.MissileTypes[].SplashFactor">
+ <dt><b>Stratagus.MissileTypes[].SplashFactor</b></dt>
+ <dd><b>Type:</b> int </dd>
+ <dd>This is the factor for splash damage. The first
tile gets full damage,
+ a tile x away from the center get damage / (x *
SplashFactor)</dd>
+ <a name="Stratagus.MissileTypes[].SpriteFrames">
+ <dt><b>Stratagus.MissileTypes[].SpriteFrames</b></dt>
+ <dd><b>Type:</b> int </dd>
+ <dd>The number of the frames for this sprite. Missile
animation is trivial,
+ It will go through the Sprite frames in order</dd>
+ <a name="Stratagus.MissileTypes[].Transparency">
+ <dt><b>Stratagus.MissileTypes[].Transparency</b></dt>
+ <dd><b>Type:</b> int (byte) </dd>
+ <dd>This is the transparency value for the missile. Value
should be between
+ 0(completely transparent) and 256(completely opaque).
NOT TESTED</dd>
+ <a name="Stratagus.MissileTypes[].Width">
+ <dt><b>Stratagus.MissileTypes[].Width</b></dt>
+ <dd><b>Type:</b> int </dd>
+ <dd>This is the width of one frame in the graphic file.</dd>
+ <!-- SCRIPT -->
</dl><hr>
- Last changed: $Id: missiletypes.html,v 1.1 2004/02/01 19:00:22 nobody_
Exp $<br>
+ Last changed: $Id: missiletypes.html,v 1.2 2004/02/01 23:12:28 nobody_
Exp $<br>
All trademarks and copyrights on this page are owned by their
respective owners.
<address>(c) 2002-2004 by <a href="http://stratagus.org">The Stratagus
Project</a></address>
</body></html>
Index: stratagus/doc/script/script-index.html
diff -u stratagus/doc/script/script-index.html:1.1
stratagus/doc/script/script-index.html:1.2
--- stratagus/doc/script/script-index.html:1.1 Sun Feb 1 11:38:46 2004
+++ stratagus/doc/script/script-index.html Mon Feb 2 10:12:28 2004
@@ -34,6 +34,8 @@
<a href="script-index.html">Script index</a>
<hr>
<a href="stratagus.html">Stratagus.*</a>
+ <a href="missiletypes.html">Stratagus.MissileTypes.*</a>
+ <a href="players.html">Stratagus.Players.*</a>
<hr>
<dl>
@@ -41,11 +43,53 @@
<dt><a href="stratagus.html#Stratagus.GameName">Stratagus.GameName</a></dt>
<dt><a href="stratagus.html#Stratagus.GamePaused">Stratagus.GamePaused</a></dt>
<dt><a
href="stratagus.html#Stratagus.LibraryFilePath">Stratagus.LibraryFilePath</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes">Stratagus.MissileTypes</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].CanHitOwner">Stratagus.MissileTypes[].CanHitOwner</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].Class">Stratagus.MissileTypes[].Class</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].DrawLevel">Stratagus.MissileTypes[].DrawLevel</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].File">Stratagus.MissileTypes[].File</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].FiredSound">Stratagus.MissileTypes[].FiredSound</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].FriendlyFire">Stratagus.MissileTypes[].FriendlyFire</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].Height">Stratagus.MissileTypes[].Height</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].Ident">Stratagus.MissileTypes[].Ident</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].ImpactMissile">Stratagus.MissileTypes[].ImpactMissile</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].ImpactSound">Stratagus.MissileTypes[].ImpactSound</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].NumBounces">Stratagus.MissileTypes[].NumBounces</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].NumDirections">Stratagus.MissileTypes[].NumDirections</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].Range">Stratagus.MissileTypes[].Range</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].Sleep">Stratagus.MissileTypes[].Sleep</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].SmokeMissile">Stratagus.MissileTypes[].SmokeMissile</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].Speed">Stratagus.MissileTypes[].Speed</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].SplashFactor">Stratagus.MissileTypes[].SplashFactor</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].SpriteFrames">Stratagus.MissileTypes[].SpriteFrames</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].Transparency">Stratagus.MissileTypes[].Transparency</a></dt>
+<dt><a
href="missiletypes.html#Stratagus.MissileTypes[].Width">Stratagus.MissileTypes[].Width</a></dt>
+<dt><a href="players.html#Stratagus.Players">Stratagus.Players</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].Allied">Stratagus.Players[].Allied</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].BuildingLimit">Stratagus.Players[].BuildingLimit</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].Demand">Stratagus.Players[].Demand</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].Enemy">Stratagus.Players[].Enemy</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].Name">Stratagus.Players[].Name</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].NumBuildings">Stratagus.Players[].NumBuildings</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].NumUnits">Stratagus.Players[].NumUnits</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].Score">Stratagus.Players[].Score</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].SharedVision">Stratagus.Players[].SharedVision</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].Slot">Stratagus.Players[].Slot</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].StartX">Stratagus.Players[].StartX</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].StartY">Stratagus.Players[].StartY</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].Supply">Stratagus.Players[].Supply</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].TotalBuildings">Stratagus.Players[].TotalBuildings</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].TotalKills">Stratagus.Players[].TotalKills</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].TotalRazings">Stratagus.Players[].TotalRazings</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].TotalUnitLimit">Stratagus.Players[].TotalUnitLimit</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].TotalUnits">Stratagus.Players[].TotalUnits</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].UnitLimit">Stratagus.Players[].UnitLimit</a></dt>
+<dt><a
href="players.html#Stratagus.Players[].UnitTypesCount">Stratagus.Players[].UnitTypesCount</a></dt>
<!-- SCRIPT -->
</dl>
<hr>
- Last changed: $Id: script-index.html,v 1.1 2004/02/01 00:38:46 nobody_
Exp $<br>
+ Last changed: $Id: script-index.html,v 1.2 2004/02/01 23:12:28 nobody_
Exp $<br>
All trademarks and copyrights on this page are owned by their
respective owners.
<address>(c) 2002-2004 by <a href="http://stratagus.org">The Stratagus
Project</a></address>
</body></html>
Index: stratagus/doc/script/script.html
diff -u stratagus/doc/script/script.html:1.3
stratagus/doc/script/script.html:1.4
--- stratagus/doc/script/script.html:1.3 Sun Feb 1 11:38:46 2004
+++ stratagus/doc/script/script.html Mon Feb 2 10:12:28 2004
@@ -34,6 +34,8 @@
<a href="script-index.html">Script index</a>
<hr>
<a href="stratagus.html">Stratagus.*</a>
+ <a href="missiletypes.html">Stratagus.MissileTypes.*</a>
+ <a href="players.html">Stratagus.Players.*</a>
<hr>
<h2>Intro - Introduction to scripting in Stratagus</h2>
@@ -159,7 +161,7 @@
<b>FIXME: this is not complete, but it should give you an idea.</b>
<hr>
- Last changed: $Id: script.html,v 1.3 2004/02/01 00:38:46 nobody_ Exp
$<br>
+ Last changed: $Id: script.html,v 1.4 2004/02/01 23:12:28 nobody_ Exp
$<br>
All trademarks and copyrights on this page are owned by their
respective owners.
<address>(c) 2004 by <a href="http://stratagus.org">The Stratagus
Project</a></address>
</body></html>
Index: stratagus/doc/script/stratagus.html
diff -u stratagus/doc/script/stratagus.html:1.1
stratagus/doc/script/stratagus.html:1.2
--- stratagus/doc/script/stratagus.html:1.1 Sun Feb 1 11:38:46 2004
+++ stratagus/doc/script/stratagus.html Mon Feb 2 10:12:28 2004
@@ -34,6 +34,8 @@
<a href="script-index.html">Script index</a>
<hr>
<a href="stratagus.html">Stratagus.*</a>
+ <a href="missiletypes.html">Stratagus.MissileTypes.*</a>
+ <a href="players.html">Stratagus.Players.*</a>
<hr>
<dl>
<!-- SCRIPT -->
@@ -56,9 +58,21 @@
<dd><b>Type:</b> string </dd>
<dd>This is the path for the stratagus data dir, the one
you specify
with -d on the command line.</dd>
+ <a name="Stratagus.SyncRand()">
+ <dt><b>Stratagus.SyncRand()</b></dt>
+ <dd><b>Type:</b> function, returns int </dd>
+ <dd>This calls the internal stratagus syncronized random
number generator.
+ It will get the same values across multiplayer games.
Make sure you
+ don't call it from unsincronized parts of the game.</dd>
+ <a name="Stratagus.MyRand()">
+ <dt><b>Stratagus.MyRand()</b></dt>
+ <dd><b>Type:</b> function, returns int </dd>
+ <dd>This calls a random number generator. Do not use this
in map
+ scripts or anything else that has to behave the same
across multiplayer
+ games.</dd>
<!-- SCRIPT -->
</dl><hr>
- Last changed: $Id: stratagus.html,v 1.1 2004/02/01 00:38:46 nobody_ Exp
$<br>
+ Last changed: $Id: stratagus.html,v 1.2 2004/02/01 23:12:28 nobody_ Exp
$<br>
All trademarks and copyrights on this page are owned by their
respective owners.
<address>(c) 2002-2004 by <a href="http://stratagus.org">The Stratagus
Project</a></address>
</body></html>
Index: stratagus/src/include/stratagus.h
diff -u stratagus/src/include/stratagus.h:1.48
stratagus/src/include/stratagus.h:1.49
--- stratagus/src/include/stratagus.h:1.48 Thu Jan 29 21:20:08 2004
+++ stratagus/src/include/stratagus.h Mon Feb 2 10:12:29 2004
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: stratagus.h,v 1.48 2004/01/29 10:20:08 nobody_ Exp $
+// $Id: stratagus.h,v 1.49 2004/02/01 23:12:29 nobody_ Exp $
#ifndef __STRATAGUS_H__
#define __STRATAGUS_H__
@@ -41,7 +41,7 @@
#define NEW_UNIT_CACHE
// New Lua scripting.
-//#define META_LUA
+#define META_LUA
// Dynamic loading.
//#define DYNAMIC_LOAD
Index: stratagus/src/stratagus/spells.c
diff -u stratagus/src/stratagus/spells.c:1.143
stratagus/src/stratagus/spells.c:1.144
--- stratagus/src/stratagus/spells.c:1.143 Thu Jan 29 23:50:35 2004
+++ stratagus/src/stratagus/spells.c Mon Feb 2 10:12:30 2004
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: spells.c,v 1.143 2004/01/29 12:50:35 nobody_ Exp $
+// $Id: spells.c,v 1.144 2004/02/01 23:12:30 nobody_ Exp $
/*
** And when we cast our final spell
@@ -565,6 +565,9 @@
global int CastPolymorph(Unit* caster, const SpellType* spell,
const SpellActionType* action, Unit* target, int x, int y)
{
+ int canplace;
+ int i;
+ int j;
UnitType* type;
DebugCheck(!caster);
@@ -575,32 +578,52 @@
type = action->Data.Polymorph.NewForm;
DebugCheck(!type);
+ x = x - type->TileWidth / 2;
+ y = y - type->TileHeight / 2;
+
caster->Player->Score += target->Type->Points;
- if (target->Type->Building) {
- caster->Player->TotalRazings++;
- } else {
- caster->Player->TotalKills++;
- }
+ if (IsEnemy(caster->Player, target)) {
+ if (target->Type->Building) {
+ caster->Player->TotalRazings++;
+ } else {
+ caster->Player->TotalKills++;
+ }
#ifdef USE_HP_FOR_XP
- caster->XP += target->HP;
+ caster->XP += target->HP;
#else
- caster->XP += target->Type->Points;
+ caster->XP += target->Type->Points;
#endif
- caster->Kills++;
+ caster->Kills++;
+ }
+
// as said somewhere else -- no corpses :)
RemoveUnit(target, NULL);
- UnitLost(target);
- UnitClearOrders(target);
- ReleaseUnit(target);
- if (UnitTypeCanMoveTo(x, y, type)) {
- MakeUnitAndPlace(x, y, type, Players + PlayerNumNeutral);
+ UnitCacheRemove(target);
+ canplace = 1;
+ for (i = 0; i < type->TileWidth; ++i) {
+ for (j = 0; j < type->TileHeight; ++j) {
+ if (!UnitTypeCanMoveTo(x + i, y + j, type)) {
+ canplace = 0;
+ i = j = 10343243;
+ }
+ }
}
- if (spell->Missile) {
- MakeMissile(spell->Missile,
- x * TileSizeX + TileSizeX / 2, y * TileSizeY +
TileSizeY / 2,
- x * TileSizeX + TileSizeX / 2, y * TileSizeY +
TileSizeY / 2);
+ if (canplace) {
+ caster->Mana -= spell->ManaCost;
+ MakeUnitAndPlace(x, y, type, Players + PlayerNumNeutral);
+ UnitLost(target);
+ UnitClearOrders(target);
+ ReleaseUnit(target);
+ if (spell->Missile) {
+ MakeMissile(spell->Missile,
+ x * TileSizeX + TileSizeX / 2, y * TileSizeY +
TileSizeY / 2,
+ x * TileSizeX + TileSizeX / 2, y * TileSizeY +
TileSizeY / 2);
+ }
+ return 1;
+ } else {
+ PlaceUnit(target, target->X, target->Y);
+ return 0;
}
- return 0;
}
/**
@@ -1154,8 +1177,9 @@
//
// Ugly hack, CastAdjustVitals makes it's own mana calculation.
//
- if (act->CastFunction!=CastAdjustVitals &&
- act->CastFunction!=CastSummon) {
+ if (act->CastFunction != CastAdjustVitals &&
+ act->CastFunction != CastPolymorph &&
+ act->CastFunction != CastSummon) {
caster->Mana -= spell->ManaCost;
}
PlayGameSound(spell->SoundWhenCast.Sound, MaxSampleVolume);
Index: stratagus/src/unit/unit_cache.c
diff -u stratagus/src/unit/unit_cache.c:1.48
stratagus/src/unit/unit_cache.c:1.49
--- stratagus/src/unit/unit_cache.c:1.48 Thu Jan 29 23:50:37 2004
+++ stratagus/src/unit/unit_cache.c Mon Feb 2 10:12:31 2004
@@ -30,7 +30,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit_cache.c,v 1.48 2004/01/29 12:50:37 nobody_ Exp $
+// $Id: unit_cache.c,v 1.49 2004/02/01 23:12:31 nobody_ Exp $
//@{
@@ -218,6 +218,7 @@
for (j = 0; j < unit->Type->TileWidth; ++j) {
mf = TheMap.Fields + (i + unit->Y) * TheMap.Width + j +
unit->X;
listitem = unit->CacheLinks + i * unit->Type->TileWidth
+ j;
+ DebugCheck(listitem->Next || listitem->Prev);
// Always add at the start of the list.
listitem->Next = mf->UnitCache;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus doc/script/missiletypes.html doc/scri...,
address@hidden <=