20171 Commits

Author SHA1 Message Date
Charles Dang
a480912ff7 T S1: don't set student's moves to 0 after moving to keep 2014-12-30 06:11:55 +11:00
Charles Dang
9dba03953b T S1: the student variable should not be translatable 2014-12-30 05:34:32 +11:00
Charles Dang
220e5912e6 T S1: fixup 1c9dc4ae3dcc. Seems we need new turn after all
Also move the menu item back into the new turn event, so it isn't available on the previous turn
2014-12-30 05:31:19 +11:00
Charles Dang
695998693f T S1: clear trying_to_be_a_wiseguy on victory 2014-12-30 05:10:07 +11:00
Charles Dang
687919b736 T S1: reduce chance of quintain for dying before turn 4
The reason for this is that if they player is lucky, they might kill him before turn 4,
and when it dies, Delf leaves, preventing the entire attack exposition from happening.
This cuts off the student's moves after they move to keep on turn 3, and adds a dialog line
by Delf regarding it.

This doesn't fix any situation where the player disregards instructions and doesn't return to
the keep, but that's their problem.
2014-12-30 05:01:24 +11:00
Charles Dang
8665840ec3 T S1: changed the route Delf takes when he leaves. He now goes via the road 2014-12-30 04:33:41 +11:00
Charles Dang
4473e2c532 T S1: made Delf face the keep after he moves 2014-12-30 04:29:41 +11:00
Charles Dang
1c9dc4ae3d T S1: fixed initial scenario end prompt
You can't have two events with the same name, and one set to first once. Only the first one will fire.
Use a slightly different name for this one to be clear
2014-12-30 04:28:17 +11:00
Charles Dang
1fab61360d T: moved a wmllint spelling exception to the correct file 2014-12-30 03:49:08 +11:00
Charles Dang
8646c57b77 T S2: initialize starting units in [side]s 2014-12-30 03:47:18 +11:00
Charles Dang
7b899320dd T S1: next_turn var doesn't exist anymore, don't clear it 2014-12-30 03:41:50 +11:00
Charles Dang
a941e3e7d1 T S1: completely refactored scenario code. More tweaks pending 2014-12-30 03:37:49 +11:00
Charles Dang
d6d952a7b1 T S1: initialize Delf in his [side] 2014-12-30 00:29:45 +11:00
Charles Dang
beaf189a6a T: replaced ALL cases of MOVE with MOVE_UNIT and deleted the former 2014-12-30 00:24:55 +11:00
Charles Dang
799ac9d250 Don't include the tutorial's _main.cfg explicitly 2014-12-30 00:15:34 +11:00
Charles Dang
9b0c1a41bf T: dropped stable_singleplayer ai aliases 2014-12-30 00:11:48 +11:00
Charles Dang
02a79264bd Include utils only once, from main 2014-12-30 00:07:47 +11:00
Charles Dang
124d264f0e Gave the tutorial it's own _main.cfg 2014-12-30 00:05:30 +11:00
Charles Dang
d2fdcefbcb T: dropped variable usage in LABEL and PRINT 2014-12-30 00:00:27 +11:00
Charles Dang
c8756ca92c T S1: beautified map 2014-12-29 23:58:39 +11:00
Charles Dang
d859adef38 Merge util files 2014-12-29 23:48:36 +11:00
Charles Dang
18284fef33 Renamed files for clarity 2014-12-29 23:46:49 +11:00
Charles Dang
62b377235e Tutorial: split S1 map into its own file 2014-12-29 23:41:27 +11:00
8573
e23ff7009c Lua: Fix uses of tostring calls as LHSs to or
This commit changes occurrences of the pattern `tostring(x) or y` to
`tostring(x or y)` in the following Lua scripts:

  - `data/lua/wml-tags.lua`
  - `data/lua/wml/items.lua`

`tostring(x) or y` is unlikely to do what the author intended (and is
pointless unless `x` is an object of a custom type with unusual
behavior), because `tostring` returns a string (`"false"` or `"nil"`)
if `x` is a falsy value (`false` or `nil`), and all strings are truthy
in Lua — thus, `tostring(x) or y` will (unless `x` is of a custom
type) *always* evaluate to `tostring(x)`, never to `y`.

`tostring(x or y)` should, I expect, give the intended behavior.
2014-12-29 10:09:48 +00:00
Charles Dang
f8c811fa4f Simplified syntax for wml_actions.chat() 2014-12-29 17:28:06 +11:00
Chris Beck
a273be5520 add a wml unit test for {CLEAR_VARIABLE} macro 2014-12-29 00:39:14 -05:00
Charles Dang
c762937e74 Simplified object:method syntax for trim() and split() 2014-12-29 15:47:44 +11:00
Charles Dang
fa079a1b3f Return first value of trim() within the function as opposed to at the call 2014-12-29 15:44:19 +11:00
Charles Dang
e35c301ff4 Fixed clear_variable by only calling first argument of of trim() 2014-12-29 15:31:05 +11:00
Chris Beck
497ed6f516 move wml [heal_unit] impl to lua 2014-12-28 17:39:39 -05:00
Charles Dang
95c94bc192 Allowed a comma separated id list for [remove_event] and [event] remove=yes 2014-12-28 20:31:45 +11:00
Charles Dang
ec985105ef Eliminate local var from trim() 2014-12-28 19:15:21 +11:00
Charles Dang
9b6f357a27 Put split-string-at-comma code into a function 2014-12-28 19:14:30 +11:00
Charles Dang
4e57408485 DiD: combine some variable clearing 2014-12-28 00:55:51 +11:00
ln-zookeeper
9a1ff1a445 Restored a subtler Shaun and Ed easter egg 2014-12-27 15:06:16 +02:00
Chris Beck
53b1309691 Merge branch 'lua' 2014-12-26 17:18:22 -05:00
Charles Dang
8a3572a62b Added [remove_event] (equivalent to [event] id= remove=yes) 2014-12-26 22:33:09 +11:00
Chris Beck
2239ab3f65 add a unit test for lua get_sides return object 2014-12-26 01:07:57 -05:00
Chris Beck
017050df70 ilua: eliminate the "_" holds last executed command feature
the ilua `_pretty_print` feature has the property that it sets _
to be what was printed, as an interpreter feature so that _
represents the results of the previous expression. However it
appears that this may conflict with some parts of our api, for
instance the _ is used to hold the return value of
wesnoth.textdomain in the lua implementation of [harm_unit].

Note that there is no actual bug that I have observed, I merely
anticipate that this _ feature won't be compatible with our
established gettext conventions.
2014-12-26 00:06:05 -05:00
Chris Beck
e73c57ead7 move wml [endlevel] impl to lua, and split into many lua funcs
the [endlevel] tag does alot of things that could quite comfortably
be split into several parts, like setting the next scenario, the
end level text, message duration, credits. this commit adds
separate lua api for each of these, leaving the rest in end_level,
and the lua tag implementation calls these variously.
2014-12-24 16:17:24 -05:00
Chris Beck
36f57ff03a Merge branch 'to_lua' 2014-12-24 16:12:52 -05:00
Chris Beck
d7bf5be356 move wml [animate_unit] to lua 2014-12-24 15:15:25 -05:00
Chris Beck
171f92a6a5 move wml [open_help] impl to lua
also fixes an issue where the help topic was being cast
unnecessarily to a tstring
2014-12-24 14:42:58 -05:00
Charles Dang
2398906fd8 Merge branch 'master' of github.com:wesnoth/wesnoth 2014-12-24 21:45:38 +11:00
Charles Dang
004af104d9 DiD S10: make Volk hang out around his castle and adjacent villages, not just his keep 2014-12-24 21:44:42 +11:00
Chris Beck
75767d3a77 move WML [kill] impl to lua 2014-12-24 05:43:37 -05:00
Chris Beck
9922b98fa3 move wml [inspect] impl to lua (and lua_gui2 namespace) 2014-12-24 05:00:44 -05:00
Chris Beck
ca58a71793 move WML [modify_side] implementation to lua 2014-12-24 04:44:25 -05:00
Chris Beck
0246026940 move WML [event] impl to lua, fixup core wml vs lua loading order
This commit moves [event] to be implemented in lua/wml-tags.lua.
It turns out that because of some questionable ordering in
data/core/_main.cfg, none of the tags defined in
data/lua/wml-tags.lua are actually defined at the time that core
is read, instead they are defined right after this. This is broken,
the entire wml library should be defined before core is read. Thus
we reorder some directives in data/core/_main.cfg to ensure this.

This commit adds lua callbacks `wesnoth.add_event_handler`,
`wesnoth.remove_event_handler` as well.
2014-12-24 04:21:58 -05:00
Chris Beck
0e365efc1a move WML [label] impl to lua 2014-12-24 03:16:49 -05:00