203 Commits

Author SHA1 Message Date
Anonymissimus
4345f5ea75 added helper functions for starting and stopping wml variable scopes
Usage for "this_unit" in modify_unit, harm_unit and find_path.
2011-10-25 16:52:18 +00:00
Simon Forsyth
ee0e491cfd Revert accidental change to wml-tags.lua 2011-10-23 15:15:59 +00:00
Simon Forsyth
5cffe7db29 Update changelog re 2011-10-22T21:43:12Z!alarantalara@gmail.com 2011-10-23 15:13:45 +00:00
Anonymissimus
029798160e Revert "[harm_unit]: added Lua workaround for bug #18795"
I do not want such workarounds to be added. shadowmaster's campaign
was still functional nevertheless. If there's an annoying bug
and nobody has the time or knowledge or energy to fix it then we must
just accept that it lingers around any annoys us.
2011-10-19 20:01:38 +00:00
Elvish_Hunter
9c0c552d4e [harm_unit]: added Lua workaround for bug #18795 2011-10-19 08:33:33 +00:00
Anonymissimus
a0d6cbc0b2 made scope of this_unit variable in modify_unit local (bug #18811) 2011-10-15 21:05:00 +00:00
Elvish_Hunter
c4dba27436 [harm_unit] cannot longer poison not living units 2011-10-10 09:19:40 +00:00
Anonymissimus
6bf39ec751 Add support to capture_village for [filter_side]#SSF.
Since capture_village already has an inline SLF, I don't want to add
a SSF at the same level since keys and tags could conflict in the future.
In case that both inline side= and [filter_side] are present,
emit an error.

Not sure whether inline side= should be deprecated; no need to break
backwards compatibility for now.
2011-10-05 16:22:40 +00:00
Anonymissimus
6ef1bcfecd remove an unused variable 2011-10-04 12:54:54 +00:00
Anonymissimus
84f1a90ebc add a comment 2011-10-04 12:54:19 +00:00
Anonymissimus
e4be4af1e7 Move store_starting_location implementation to lua.
Add SSF support along the way. No deprecation for default side=1 needed,
since if left empty, an array with all starting locations is created,
side 1 being the first element and $array[0].something is the same as

$array.something.

(I used the same trick for [store_side] already.)
2011-10-03 20:53:11 +00:00
Elvish_Hunter
b2d6824bf7 [find_path]: ignore_visibility -> check_visibility;
ignore_units -> check_zoc; ignore_teleport -> check_teleport
2011-10-02 19:24:44 +00:00
Elvish_Hunter
6300b1b3bf Added [find_path] 2011-09-28 19:24:55 +00:00
Anonymissimus
8cc18af32a add a comment describing the .colour warning from [store_side]... 2011-09-27 23:02:30 +00:00
Anonymissimus
d3d0400ed0 revert part of 2011-09-08T19:16:01Z!thonsew@yahoo.com (resonless change to [item] behavior) 2011-09-27 23:01:26 +00:00
Anonymissimus
febb9da2ca Reverted 2011-09-21T21:44:58Z!thonsew@yahoo.com and 2011-09-20T21:21:21Z!thonsew@yahoo.com.
thonsew: The lua interface is not your playground. This is not the way
I want the lua files or its C++ interface to be modified. You are
invited to talk with me on IRC.

some of the main reasons:

-Your revisions contain lots of unneccessary changes, some of which
 break existing lua or wml without a reason. Do you ever look at the
 diffs?

-Your revisions pack a lot of unrelated stuff together into one.

2011-09-21T21:44:58Z!thonsew@yahoo.com makes sense in some parts and is what you should have
done in the first place.
2011-09-22 17:09:50 +00:00
Thonsew
70e6077f9d Fixed some of the t_token references that were leaking out into WML land.
This fixes all of the lua errors in wesnoth -t.  This does not fix all
of the errors in Anonymissimus' multiplayer add-on, which are due to
references leaking through the arbitrary code hole in wml-tags.lua:250
2011-09-21 21:44:58 +00:00
Thonsew
e59dc97260 Added support for t_token to lua code.
1. Created a t_token metatable along with support code for indexing,
garbage collection, tostring, tonumber, comparison and concatenation.

2. Adjusted string comparison and lookup in lua code to work with
either t_token or string.

This addresses in part bug #18631, bug #18695.  Before this lua was
treating all t_token as either tstrings or strings.
2011-09-20 21:21:21 +00:00
Thonsew
2bf6377351 Changed config and vconfig to use a token representation...
...t_token in place of std::string.  t_token compares, copies, copy
constructs and hashes in 1 operation instead of proportional to the
length of the string.
2011-09-08 19:16:01 +00:00
Anonymissimus
e8f6531a86 Completely removed the old x,y=$x1,$y1 default in [remove_item],
since when running into this rare exception (if the SLF doesn't
matching anything) it could be hard to figure out what happens.

[remove_item] does nothing in this case now.
2011-09-01 19:06:56 +00:00
Anonymissimus
75bf37ed86 improved [store_items] to store only items on locs matching given SLF 2011-08-21 17:39:11 +00:00
Elvish_Hunter
9853a5d3f3 Added patch #2470
(support for harmer and xp calculation), with a few modifications.
2011-08-19 08:12:34 +00:00
Anonymissimus
fdb74894be added new wml tag store_items 2011-08-17 18:38:07 +00:00
Elvish_Hunter
bb15de6c40 Added [primary_attack] support to [harm_unit] 2011-08-15 14:09:31 +00:00
Anonymissimus
e7688ed406 add SLF support to [event][remove_item] 2011-08-14 00:24:58 +00:00
Anonymissimus
38091cb48a add SLF support to [event][item] 2011-08-14 00:24:42 +00:00
Anonymissimus
66e84f78ce fixed error message 2011-08-14 00:24:26 +00:00
Anonymissimus
7ce40d876b strip trailing whitespace 2011-08-14 00:24:08 +00:00
Elvish_Hunter
4d0e818dd5 [harm_unit] now always uses wesnoth.float_label to display the damage,
to avoid that an incorrect weapon filter may prevent displaying said damage
2011-08-12 10:08:26 +00:00
Dmitry Kovalenko
a293e91db3 Completed cleanup functionality(kind of hacky, might need refactoring). Also done some minor fixes 2011-07-08 09:40:08 +00:00
Dmitry Kovalenko
bab732a43e Sticky candidate actions are constructed if sticky=yes specified
(Lua engine only). Also added missing unit coordinate parameters to
the config
2011-07-04 11:19:56 +00:00
Dmitry Kovalenko
8d65c3b7f7 Added functionality to the [add_ai_behavior] tag.
Not fully working at the moment, but is usable. The usage syntax will
most probably remain, but the internals will be modified.
2011-06-30 14:14:46 +00:00
Anonymissimus
0832173ddb made scenario objectives work even if [objective]description= is empty 2011-06-13 15:58:48 +00:00
Anonymissimus
955ebd0eea removed unused parameter i from get_side_count 2011-05-18 23:05:51 +00:00
Anonymissimus
242ecb7848 fixed [select_unit] ingoring highlight=false parameter 2011-05-18 19:39:44 +00:00
Anonymissimus
495325d5af added attribute "side" in array created by store_side 2011-05-17 15:56:07 +00:00
Anonymissimus
12093d8784 moved [store_side] to lua; added SSF support
an array is created is several sides match

no backwardscompat-hack or deprecation needed since $var. ... is the
same as $var[0]. ... ,

clearing a container variable is the same as if it was an array and
side=1 automatically matches first for an empty filter :)
2011-05-17 13:27:13 +00:00
Anonymissimus
c1d8858c90 modified iterator function helper.get_sides...
...to return wesnoth.sides[side_number], side_number

TBH, I dont't fully understand the syntax, especially the one before
this, and it seems silene did experiment with it too...but this works
now at least.
2011-05-17 13:26:58 +00:00
Anonymissimus
4d03cdb875 made it so that the new tags allow-, disallow- and...
...set_extra_recruit take a extra_recruit= key holding the types and
an inline SUF
2011-05-15 16:42:44 +00:00
Anonymissimus
097090646d reverted [set_recruit]recruit= -> [set_recruit]type= change
2011-05-13T21:29:58Z!anonymissimus@arcor.de
2011-05-13T21:30:14Z!anonymissimus@arcor.de
2011-05-13T22:28:06Z!anonymissimus@arcor.de
2011-05-14 00:06:04 +00:00
Anonymissimus
2c83b81274 corrected tag names in error messages 2011-05-13 21:30:31 +00:00
Anonymissimus
8f020a7f3c same for set_extra_recruit 2011-05-13 21:30:14 +00:00
Anonymissimus
f8f4c547d4 deprecated [set_recruit]recruit= in favor of type=
(how annoying this is to write type= as in allow_* and disallow_*, to
read the wiki and then see it's recruit=...)
2011-05-13 21:29:58 +00:00
Anonymissimus
cba9b17a45 renamed side_number in some recently modified tags...
...since it is not neccessarily the same as the side_number
2011-05-13 21:29:42 +00:00
Anonymissimus
da3ae555d6 removed unused local function get_team
All of the side-taking lua tags have now a SSF, except for
capture_village for which I yet don't have a good idea how to deal
with.
2011-05-13 16:58:36 +00:00
Anonymissimus
f6e09f4f72 added SSF to [store_gold] 2011-05-13 16:58:18 +00:00
Fabian Müller
a48e0dfda1 Corrected Indentation. 2011-05-13 16:16:37 +00:00
Fabian Müller
cf47db9470 Ported the [allow_recruit] tag to lua and removed the c++ implementation.
Create an accessor for the help systems known units list for the lua
coder.  (used by allow_recruit)

Added an accessor for the new unit attribute "extra_recruit" for the lua coder.

Implemented [allow_extra_recruit], [dissallow_extra_recruit] and
[set_extra_recruit] by lua defined wml tags.

AI awareness is still to be done, the code locations are marked TODO
in unit.cpp.
2011-05-13 11:23:22 +00:00
Anonymissimus
923ae89cce Converted [chat] to use new side filter syntax.
For this one it's easy since the default was already "all sides".

Adds support for inline SSF.
2011-05-13 00:54:54 +00:00
Anonymissimus
5207f3cb8a deprecated side= empty in disallow_recruit,
...allow_recruit and set_recruit this way

The [filter_side] tag should never have been added to allow_recruit
and I included disallow- and set_recruit only since allow_recruit was
already changed. These tags will be much nicer with an inline ssf. I'm
pretending now that [filter_side] was never added and hope nobody uses
it until the next release...the whole thing isn't yet in the changelog
and not fully in the wiki anyway...
2011-05-11 20:45:59 +00:00