commit 5af54b92893eaa676f6292d1e36a56cc8903242d Author: David Vogel Date: Fri Oct 18 16:14:06 2019 +0200 Initial commit diff --git a/data/any files here will override the game's default files b/data/any files here will override the game's default files new file mode 100644 index 0000000..e69de29 diff --git a/data/items_gfx/handgun.png b/data/items_gfx/handgun.png new file mode 100644 index 0000000..354c357 Binary files /dev/null and b/data/items_gfx/handgun.png differ diff --git a/files/actions.lua b/files/actions.lua new file mode 100644 index 0000000..b2a652a --- /dev/null +++ b/files/actions.lua @@ -0,0 +1,17 @@ +table.insert( actions, +{ + id = "SEA_OF_SWAMP", + name = "Sea of swamp", + description = "How useful", + sprite = "mods/example/files/actions/sea_swamp.png", + type = ACTION_TYPE_MATERIAL, + spawn_level = "0,4,5,6", -- BERSERK_FIELD + spawn_probability = "1,1,1,1", -- BERSERK_FIELD + price = 350, + mana = 140, + max_uses = 3, + action = function() + add_projectile("mods/example/files/actions/sea_swamp.xml") + c.fire_rate_wait = c.fire_rate_wait + 15 + end, +} ) \ No newline at end of file diff --git a/files/actions/sea_swamp.png b/files/actions/sea_swamp.png new file mode 100644 index 0000000..4c4deb4 Binary files /dev/null and b/files/actions/sea_swamp.png differ diff --git a/files/actions/sea_swamp.xml b/files/actions/sea_swamp.xml new file mode 100644 index 0000000..86911cb --- /dev/null +++ b/files/actions/sea_swamp.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + diff --git a/files/magic_numbers.xml b/files/magic_numbers.xml new file mode 100644 index 0000000..0f3f779 --- /dev/null +++ b/files/magic_numbers.xml @@ -0,0 +1,5 @@ + + diff --git a/files/use this for mod-specific files to avoid name conflicts between mods b/files/use this for mod-specific files to avoid name conflicts between mods new file mode 100644 index 0000000..e69de29 diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..3a36ed4 --- /dev/null +++ b/init.lua @@ -0,0 +1,21 @@ +function OnModPreInit() + print("Mod - OnModPreInit()") -- first this is called for all mods +end + +function OnModInit() + print("Mod - OnModInit()") -- after that this is called for all mods +end + +function OnModPostInit() + print("Mod - OnModPostInit()") -- then this is called for all mods +end + +function OnPlayerSpawned( player_entity ) -- this + GamePrint( "Mods says: Player entity id: " .. tostring(player_entity) ) +end + + +-- this code runs when all mods' filesystems are registered +ModLuaFileAppend( "data/scripts/gun/gun_actions.lua", "mods/example/files/actions.lua" ) -- basically dofile("mods/example/files/actions.lua") will appear at the end of gun_actions.lua +ModMagicNumbersFileAdd( "mods/example/files/magic_numbers.xml" ) -- will override some magic numbers using the specified file +print("Example mod init done") diff --git a/mod.xml b/mod.xml new file mode 100644 index 0000000..92b6dc5 --- /dev/null +++ b/mod.xml @@ -0,0 +1,5 @@ + + \ No newline at end of file