summaryrefslogtreecommitdiff
path: root/src/scripting/scriptmanager.cpp
AgeCommit message (Collapse)AuthorFilesLines
2023-05-15General code cleanupsThorbjørn Lindeijer1-0/+1
* Overall includes cleanup * Use std::make_pair * Make some functions const
2022-08-19Apply C++11 fixitsThorbjørn Lindeijer1-1/+1
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2013-04-11Converted Being into a ComponentErik Schilling1-1/+1
I did not really care too much about staying consistent with the use of static_casts to Actors since they are only temporary anyway until Actor is a component too.
2013-02-21Introduced Script::ContextErik Schilling1-1/+1
This should allow to finally call functions to lua without having to care about working around situations where a lua call causes a c++ call which needs to call to lua again. Tested against the source of tales repository data.
2012-05-20Removed no longer needed codeErik Schilling1-8/+0
I forgot to remove this during my special cleanup Reviewed-by: bjorn.
2012-04-04Enhanced special supportErik Schilling1-33/+0
- Made the current charge being saved. - Added script binds: - chr_set_special_recharge_speed - chr_get_special_recharge_speed - chr_set_special_mana - chr_get_special_mana - get_special_info - Added special info lua class. Functions: - name - needed_mana - rechargeable - on_use - on_recharged - category Further the engine no longer sets charge to 0 after using of specials this allows more flexbilillity (like failing specials). Changes on the xml database: - recharge renamed to rechargeable (needed by client and server) - needed - the needed mana to trigger a special (server only) - rechargespeed - the defailt recharge speed in mana per tick (server only) - target - the type of target (either being or point) (server and client) I also made the lua engine pushing nil instead of a 0 light userdata when the pointer was 0. Database update needed. Change is tested. Mana-Mantis: #167, #156 Reviewed-by: bjorn.
2012-03-03Added further missing callbacksErik Schilling1-4/+28
Reviewed-by: bjorn.
2012-03-02Use callbacks for handling character death and respawnThorbjørn Lindeijer1-13/+0
Rather than relying on the availability of global functions with certain predefined names, the Lua script now calls API functions to set which function should be called on these global events. This mechanism should make it easier to avoid name collisions in the global namespace, which is important now that there is only a single script state. For these global events this was not likely to become a problem, but this solution can also be used for callbacks on specific item or monster types, or even allow setting callbacks on certain instances. Reviewed-by: Erik Schilling Reviewed-by: Yohann Ferreira
2012-03-02Merged all the different Lua states into oneThorbjørn Lindeijer1-0/+98
No more Lua state for each status effect, monster, item effect or map. All scripts are loaded into the same state. This should be more efficient overall and make it easier to implement dynamic reloading of the scripts in the future. Now, this introduces the problem of name collisions between different Lua scripts. For now this is solved by using more specific function names, like 'tick_plague' and 'tick_jump' rather than just 'tick'. The plan is however to get rid of these globals, and register these callbacks from the script, so that they can be local functions without the danger of colliding with other scripts. Reviewed-by: Erik Schilling Reviewed-by: Yohann Ferreira