Commit graph

15415 commits

Author SHA1 Message Date
joris
409aa786c4 Clean CViewPort interface :
Use PixelPos or Vec2i instead of x, y
2012-02-20 10:11:29 +01:00
cybermind
22c596f62a Removed CommandSetResource action. In most cases it desynced the replays, and now there is another way to implement needed feature (it was added to make trading between players) through animations. 2012-02-19 22:03:29 +06:00
joris
1d66191f8d Some clean up with Missile :
- use ref
- use PixelPos instead of x, y
2012-02-19 16:46:07 +01:00
joris
006cba3793 [minor] Remove CUnit::OrderCount 2012-02-19 12:43:19 +01:00
joris
bd83c2e638 Fix SavePlayers
typo when I applied the patch
2012-02-19 12:42:33 +01:00
joris
9ef297b3a7 [+]New unit-type flag "NonSolid", which allow the building to be entered by other units. The same behaviour occur if you set the building's health to 0.
Patch from Cybermind
2012-02-19 10:18:17 +01:00
joris
b1365caee7 [+]Added impacts when unit is being hit. Use Impact = {"damagetype1","missiletype1",...} The "general" and "shield" keywords are reserved: the "general" will be used for all hits without damagetype and "shield" will be used to make an impact when unit has ShieldPoints.
Patch from Cybermind.
2012-02-19 10:10:26 +01:00
joris
0cc04664b6 Fix mixed EOL (\n, \r\n)
fix small bugs
2012-02-19 09:59:01 +01:00
joris
f8aff0f96d [+]Integer constants in animations could be given as unit's or player's variables.
Definition of animation variable: 
	v_<unit_variable.tag>, where unit_variable - any variable(you can also use user defined variables) of the current unit, tag - variable's tag(Value,Max,Increase,Enable,Percent).
Example: v_HitPoints.Value
Percent returns the proportion between Value and Max in range 0..100
	t_<unit_variable.tag> - same as previous, but refers to unit's current goal unit(target in attack animation, mine in resource etc.). If goal doesn't exist, returns 0.
	p_<playernum.property[.argument]> - where playernum - player's number(you can use "this" to refer the unit's player), property - player's property(see the GetPlayerData function for more information), optional <argument> - specifies the property's argument(need for resources and unit-types)
Examples: p_1.TotalUnitLimit p_this.Resources.gold
	r_<value> - returns the random value between 0 and <value>
Though if vaiable couldn't be reconized, game will try to convert it into integer constant(0 will be returned if convertation fails).
[+]New actions in animations:
	(modified) "spawn-missile <missile-type> <startx> <starty> <destx> <desty> <flags>" - spawns <missile-type> relative to the current unit adding <startx> and <starty> to position. <destx> and <desty> specify the missile's destination point. Could be used as more configurable replacement to the standard "attack" action. <flags> used to configure the action, you should specify it separated by points:
		"damage" - missile will generate damage, values are taken from the action unit.
		"totarget" - missile will ignore <destx> and <desty> and will fly to unit's current goal.
		"pixel" - missile will use pixel coordinates instead of tile coordinates, useful for more accurate missile placing.
		"reltarget" - the source of missile will be the unit's current target, so all parameters will be calculated depending of target's parameters, not source's(even the "totarget" will shot the missile back to source unit). Through the damage parameters are always taken from the source unit.
		"ranged" - missile will check the current max and min attack ranges from the unit("reltarget" inverses logic)
	"spawn-unit <unit-type> <offx> <offy> <range> <player>" - spawn <unit-type> relative to the current unit adding <offx> and <offy> to position. <range> specifies the maximum distatnce from the source unit.
		Example: "spawn-unit unit-something 2 1 v_AttackRange.Value this"
	"if-var <lvalue> <rvalue> <condition> <state>" - jump animation frame to label <state>, if <lvalue> is <condition> to <rvalue>
		Possible conditions are:
		1 - greater or equal
		2 - greater
		3 - less or equal
		4 - less
		5 - equal
		6 - not equal
		Example: this code will show different animation frames depending of unit's current health:
		 Still = {"if-var v_HitPoints.Percent 50 3 damaged50",
			"frame 0", "wait 1", "frame 0", "wait 1","goto end",
			"label damaged50",
			"frame 1", "wait 1", "frame 1", "wait 1",
			"label end"}

	"set-var <var> <mod> <value>" - sets the current unit's <var> variable. <mod> specifies, how should be <value> applied to <var>:
		1 - <value> will be added to <var>'s current value.
		2 - <value> will be subtracted from <var>'s current value.
		3 - <var>'s current value will be multiplied to <value>.
		4 - <var>'s current value will be divided to <value>.
		5 - <var>'s current value will be divided to <value> and remainder will be taken as value.
			Warning: if <value> = 0 in 4 and 5, the game will bomb out with a error.
	"set-player-var <player> <var> <value> <mod>[ <argument>]" - sets the <player>'s <var>. The <value> and <mod> are used same as in set-var. Optional <argument> - specifies the <var>'s argument(need for resources and unit-types)
	"die[ <deathtype>]" - causes unit to die. If <deathtype> is set, unit will play his extra death animation depending on <deathtype>, if he has one.
[-]Health states in animations are removed, should use "if-var" animation to do this.

Patch frpm Cybermind
2012-02-18 17:21:40 +01:00
joris
d2e61fda55 [+]New parameter in the "spawn-missile" spell, added "use-unit-var" which uses caster's damage parameters and ignores the "damage" field.
[+]New parameter in the "polymorph" spell, added "player-caster" parameter, which converts target unit to caster's side.

Patch from Cybermind
2012-02-18 13:43:16 +01:00
joris
590805e3bf [+]New missile class, "missile-class-tracer", this missile will seek towards the target.
[+]New missile class, "missile-class-clip-to-target", this missile will remains clipped to target unit and will play it's animation once, then target will take the damage.
[+]Added CorrectSphashDamage flag in missiles for splash damages, you can use it to prevent damaging other units, which terrain type didn't match the missile's target's unit's terrain type (e.g. don't damage flyers if missile is targeted to land unit)

Patch from Cybermind
2012-02-18 13:41:14 +01:00
Pali Rohár
8d6293949d Fix compilation with gcc 4.2 - Remove ref in function for_each 2012-02-18 10:16:57 +01:00
Pali Rohár
65d29fdd8e CMake: gcc - make sure that char is signed 2012-02-18 10:16:04 +01:00
joris
55d2e864ee New unit-type flag "Wall", which will treat unit as wall.
This will use the unit's Direction field to show different wall connections.
The unit should be a building and have NumDirections = 16 and Flip = false.
The wall unit didn't count in GetNumOpponents. When it attacked, AI didn't fight back and no warnings are shown.

NOTE: need to modify triggers, so they won't count the wall units when calculating player's remaining units. Not needed for those games which don't use this feature. 

Wall mapping:
 Frame 0 - wall without connections.
 Frame 1 - wall with north connection.
 Frame 2 - wall with west connection.
 Frame 3 - wall with north and west connections.
 Frame 4 - wall with south connection.
 Frame 5 - wall with south and north connections.
 Frame 6 - wall with south and west connections.
 Frame 7 - wall with south, north and west connections.
 Frame 8 - wall with east connection.
 Frame 9 - wall with east and north connections.
 Frame 10 - wall with east and west connections.
 Frame 11 - wall with east, north and west connections.
 Frame 12 - wall with east and south connections.
 Frame 13 - wall with east, south and north connections.
 Frame 14 - wall with east, south and west connections.
 Frame 15 - wall with all connections.

patch from Cybermind.
2012-02-18 09:59:57 +01:00
joris
d1ad94a052 Change action_ressource to search an other mine instead of returning to depot
Patch from Cybermind.
2012-02-18 09:51:58 +01:00
joris
3831e149fc missing file for "Storing" 2012-02-18 09:41:01 +01:00
joris
485c46c4ec Fix pkg to be coherent with src.
Fix typo in AStarDebug code.

Patch from cybermind.
2012-02-17 16:07:07 +01:00
joris
dc044a9c70 Add DefineDefaultResourceMaxAmounts() to define max value per resource.(default value is 0, so change it in lua).
Add "Storing" to UnitType to increase MaxResourceAmount

Patch from cybermind.
2012-02-17 15:57:11 +01:00
joris
5d4ddd2508 Create specific "construtor" for each order. 2012-02-17 09:05:42 +01:00
joris
0e54eae28e Rev.8022 fixed a warning, but broke the behavior of some method.
Here is the fix for these methods.
2012-02-16 14:59:44 +01:00
joris
96dc321b38 fix Assert with AssignWorkerToMine when mine is destroyed. 2012-02-15 12:38:39 +01:00
joris
137e4e58fd Move some code into COrder 2012-02-14 12:08:22 +01:00
joris
a34a1b8828 Fix compilation with MSVC 2012-02-14 12:01:26 +01:00
joris
0b6296d96f NewResetPath is now a method in COrder instead of a Macro 2012-02-13 15:44:20 +01:00
joris
6341a4cafd Clean up :
- use reference,
- remove dead code (class AiTransportRequest)
2012-02-13 15:24:12 +01:00
joris
7b2f40f2f1 Fix warning with gcc 2012-02-13 15:21:29 +01:00
joris
2308356ddb Use delete with new instead of free. 2012-02-13 12:41:37 +01:00
joris
79d5c7c344 move inner class CUnit::Corder to actions.h 2012-02-13 12:28:38 +01:00
joris
a8892060d1 CUnit::SavedOrder is now a pointer. 2012-02-12 11:28:35 +01:00
joris
ec080631d9 Use less memory in AiCollectResources.
use std::sort instead of qsort.
2012-02-11 16:06:33 +01:00
joris
12e8eb6846 Replace some COrder in CUnit by pointer.
Begin to have order and action more linked.
2012-02-07 14:15:16 +01:00
joris
0bd9d6ad4c Move order data from CUnit to COrder. 2012-02-06 14:49:52 +01:00
joris
e4e9e51c22 Fix bug in AStarMarkGoal with maxRange > 2 2012-02-03 14:53:48 +01:00
joris
a3c5e8f5c8 Fix bug in AiAttack which set unit.GroupId to 0.
(Force[force].Reset() should be placed before the loop)
Remove the behavior of changing of force index (since it doesn't work befor and it is strange)
Some clean up.
2012-02-03 14:52:55 +01:00
joris
7eb7972e5b Merge.
seem that my previous change have been overwrited :-/
2012-01-26 13:53:36 +01:00
Pali Rohár
29078444ef Merge network submodule from boswars-engine to stratagus 2012-01-24 18:41:56 +01:00
joris
09f642805e Fix ActionRessource and DeassignWorkerFromMine 2012-01-23 11:59:13 +01:00
joris
04c20eb84d Fix warning. 2012-01-23 11:42:20 +01:00
joris
e61a271d9c Fix warning in guichan : variable set not used. 2012-01-23 11:22:11 +01:00
joris
350b038d3b clean up : remove unused function UnitFindMiningArea
replace some x,y by pos
add const, and replace pointer by ref
2012-01-21 14:03:16 +01:00
joris
19bb9fbd75 Fix pathfinding to tree 2012-01-20 13:39:49 +01:00
joris
48fb47ce8f Fix autoattack for still action : Now tower attacks correctly in wargus.
some clean up
2012-01-20 10:58:56 +01:00
joris
673885a12d Remove most warnings for variable set but never used. 2012-01-19 11:19:45 +01:00
Pali Rohár
a1e9861094 cmake: Add sections for tolua pkg files and doxygen depends files
Also remove file names with '*' and then cmake with ninja works too
2012-01-17 01:25:05 +01:00
feb
e45bb6b2bf Do not show waypoints for enemy units when SHIFT key is pressed down.
Fix by Pali Rohár in the stratagus engine 
(http://bazaar.launchpad.net/~stratagus/stratagus/trunk/revision/7857).

Reported by cybermind (https://bugs.launchpad.net/stratagus/+bug/633863).
2012-01-08 12:11:40 +00:00
Pali Rohár
b9af3a9754 Fixed segfault, patch by Neil Tan 2012-01-07 16:50:59 +01:00
Pali Rohár
780a035f95 Fixed problem: unit unable to find path to goal if unit is next to goal
Patch by Neil Tan
2012-01-07 16:49:03 +01:00
Pali Rohár
84d1fe7fcd Fixed problem: worker unable to do anything after building structure
Patch by: Neil Tan
2012-01-07 16:47:40 +01:00
Pali Rohár
8d4e9572f5 Fixed compilation on Maemo with Touchscreen 2012-01-02 23:13:23 +01:00
Pali Rohár
281029f150 Fixed maemo-extract header 2012-01-02 11:37:51 +01:00