diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-11-12 14:39:15 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2021-11-12 14:39:15 +0100 |
commit | 19cd4e7ea97d08d61b5ba650a471bbd2e814d779 (patch) | |
tree | 78aeec5b2be9c5f7519554ad936405c68c40f637 /roleplay.lua | |
parent | d4da90fada58be5eda399795ffbc82a1365d348b (diff) | |
download | furrybot-19cd4e7ea97d08d61b5ba650a471bbd2e814d779.tar.xz |
Structure overhaul
Diffstat (limited to 'roleplay.lua')
-rw-r--r-- | roleplay.lua | 60 |
1 files changed, 8 insertions, 52 deletions
diff --git a/roleplay.lua b/roleplay.lua index 84883bc..59c8869 100644 --- a/roleplay.lua +++ b/roleplay.lua @@ -1,58 +1,14 @@ local http, env, storage local C = minetest.get_color_escape_sequence -furrybot.commands.cry = furrybot.solo_roleplay_command("cries") -furrybot.commands.laugh = furrybot.solo_roleplay_command("laughs") -furrybot.commands.confused = furrybot.solo_roleplay_command("is confused") -furrybot.commands.smile = furrybot.solo_roleplay_command("smiles") -furrybot.commands.hug = furrybot.interactive_roleplay_command("hugs") -furrybot.commands.cuddle = furrybot.interactive_roleplay_command("cuddles") -furrybot.commands.kiss = furrybot.interactive_roleplay_command("kisses") -furrybot.commands.hit = furrybot.interactive_roleplay_command("hits") -furrybot.commands.slap = furrybot.interactive_roleplay_command("slaps") -furrybot.commands.beat = furrybot.interactive_roleplay_command("beats") -furrybot.commands.lick = furrybot.interactive_roleplay_command("licks") - -furrybot.commands.marry = furrybot.request_command(function(name, target) - if storage:contains(name .. ".partner", target) then - furrybot.error_message(name, "You are already married to", storage:get_string(name .. ".partner")) - return false - elseif storage:contains(target .. ".partner", name) then - furrybot.error_message(name, target .. " is already married to", storage:get_string(target .. ".partner")) - return false - else - furrybot.ping_message(target, name .. " proposes to you. Type !accept to accept or !deny to deny.", furrybot.colors.system) - end -end, function(name, target) - storage:set_string(name .. ".partner", target) - storage:set_string(target .. ".partner", name) - furrybot.send("Congratulations, " .. furrybot.ping(name, furrybot.colors.roleplay) .. "&" .. furrybot.ping(target, furrybot.colors.roleplay) .. ", you are married. You may now kiss :).", furrybot.colors.roleplay) -end) -furrybot.commands.propose = furrybot.commands.marry -furrybot.unsafe_commands.marry = true -furrybot.unsafe_commands.propose = true - -function furrybot.commands.divorce(name) - if storage:contains(name .. ".partner") then - local partner = storage:get_string(name .. ".partner") - storage:set_string(name .. ".partner", "") - storage:set_string(partner .. ".partner", "") - furrybot.ping_message(name, "divorces from " .. partner .. " :(", furrybot.colors.roleplay) - else - furrybot.error_message(name, "You are not married") - end -end -furrybot.unsafe_commands.divorce = true - -function furrybot.commands.partner(name, target) - target = target or name - if storage:contains(target .. ".partner") then - furrybot.ping_message(name, (target == name and "You are" or target .. " is") .. " married to " .. storage:get_string(target .. ".partner"), furrybot.colors.system) - else - furrybot.error_message(name, (target == name and "You are" or target .. " is") .. " not married") - end -end -furrybot.commands.married = furrybot.commands.partner +furrybot.solo_roleplay_command("cry", "cries") +furrybot.solo_roleplay_command("laugh", "laughs") +furrybot.solo_roleplay_command("confused", "is confused", "Be confused") +furrybot.solo_roleplay_command("smile", "smiles") +furrybot.interactive_roleplay_command("hug", "hugs") +furrybot.interactive_roleplay_command("cuddle", "cuddles") +furrybot.interactive_roleplay_command("kiss", "kisses") +furrybot.interactive_roleplay_command("hit", "hits") return function(_http, _env, _storage) http, env, storage = _http, _env, _storage |