Skip to content

Commit

Permalink
Send bounty kill, build timer, and donation messages to IRC relay (#1231
Browse files Browse the repository at this point in the history
)

The IRC relay part is done by https://github.com/MT-CTF/servermods/blob/04dfa797f71ab32e6efface561d0fc035d0c7be2/irc_chat/init.lua#L35

* Initial commit

* Adding build_timer.lua changes

* Removing uneccessary lines

* Add map author to new match announcement

* Fixing luacheck line error
  • Loading branch information
src4026 authored Sep 24, 2023
1 parent 1187316 commit 8dccca2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions mods/ctf/ctf_modebase/bounties.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ function ctf_modebase.bounties.claim(player, killer)
end

local rewards = bounties[pteam].rewards
minetest.chat_send_all(minetest.colorize(CHAT_COLOR,
string.format("[Bounty] %s killed %s and got %s", killer, player, get_reward_str(rewards))
))
local bounty_kill_text = string.format("[Bounty] %s killed %s and got %s", killer, player, get_reward_str(rewards))
minetest.chat_send_all(minetest.colorize(CHAT_COLOR, bounty_kill_text))
ctf_modebase.announce(bounty_kill_text)

bounties[pteam] = nil
return rewards
Expand Down
4 changes: 4 additions & 0 deletions mods/ctf/ctf_modebase/build_timer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ function ctf_modebase.build_timer.finish()
timer:cancel()
timer = nil
hud:remove_all()
local text = "Build time is over!"
minetest.chat_send_all(text)
ctf_modebase.announce(text)

ctf_modebase.on_match_start()

Expand Down Expand Up @@ -116,3 +119,4 @@ minetest.register_chatcommand("ctf_start", {
return true, "Build time ended"
end,
})

6 changes: 5 additions & 1 deletion mods/ctf/ctf_modebase/match.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ function ctf_modebase.start_match_after_vote()
minetest.settings:set("time_speed", map.time_speed * 72)

ctf_map.announce_map(map)
ctf_modebase.announce(string.format("New match: %s map, %s mode", map.name, HumanReadable(ctf_modebase.current_mode)))
ctf_modebase.announce(string.format("New match: %s map by %s, %s mode",
map.name,
map.author,
HumanReadable(ctf_modebase.current_mode))
)

ctf_modebase.on_new_match()

Expand Down
6 changes: 3 additions & 3 deletions mods/ctf/ctf_modebase/ranking_commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ minetest.register_chatcommand("donate", {
current_mode.recent_rankings.add(name, {score=-score}, true)

donate_timer[name] = os.time()
local donate_text = string.format("%s donated %s score to %s for their hard work", name, score, pname)
minetest.chat_send_all(minetest.colorize("#00EEFF", donate_text))
ctf_modebase.announce(donate_text)

minetest.chat_send_all(minetest.colorize("#00EEFF",
string.format("%s donated %s score to %s for their hard work", name, score, pname)
))
minetest.log("action", string.format(
"Player '%s' donated %s score to player '%s'", name, score, pname
))
Expand Down

0 comments on commit 8dccca2

Please sign in to comment.