Skip to content

Commit

Permalink
updated deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gtnardy committed Oct 26, 2023
1 parent fcd0da0 commit c8e82cf
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Client/Index.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Events.Subscribe("UpdateMatchState", function(new_state, remaining_time, total_p
if (Halloween.current_role == 0) then
HUD:CallEvent("UpdatePumpkinsFound", total_pumpkins, pumpkins_found)

-- Updates amount of knights and survivors
-- Updates amount of knights and survivors
for k, p in pairs(Player.GetPairs()) do
local role = p:GetValue("Role")
local is_alive = p:GetValue("IsAlive")
Expand Down Expand Up @@ -343,7 +343,7 @@ Timer.SetInterval(function()
if (not Halloween.is_trapdoor_opened) then
for k, p in pairs(Prop) do
local distance = local_character:GetLocation():Distance(p:GetLocation())
if (p:GetAssetName() == "halloween-city-park::SM_Pumpkin_Lit" and distance < 5000) then
if (p:GetMesh() == "halloween-city-park::SM_Pumpkin_Lit" and distance < 5000) then
HUD:CallEvent("TriggerRadar")

local pitch = 1
Expand Down
33 changes: 21 additions & 12 deletions Package.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# package configurations
[package]
# package name
name = "Halloween"
# vault configurations
[meta]
# friendly name
title = "Halloween"
# contributors
author = "nanos™"
# version
version = "1.3.4"
# image URL
image = "https://i.imgur.com/WJDACbZ.jpg"
# package type: 'script' (normal package), 'game-mode' (unique package - can only load one at a time), 'library' (doesn't start a Lua VM) or 'loading-screen' (special package for loading screen)
type = "game-mode"
# whether to force the custom map script to do not load
force_no_map_script = false
version = "1.3.5"

# game-mode configurations
[game_mode]
# whether to force the custom map package to do not load
force_no_map_package = false
# auto destroy all entities spawned by this package when it unloads
auto_cleanup = true
# whether to load all level entities on client - only enable it if your package needs to use level static meshes entities
load_level_entities = false
# the game version (major.minor) at the time this package was created, for granting compatibility between breaking changes
compatibility_version = "1.62"
# packages requirements
packages_requirements = [

]
# asset packs requirements
assets_requirements = [
Expand All @@ -26,3 +29,9 @@
compatible_maps = [
"halloween-city-park::Halloween_CityPark",
]

# game-mode custom settings configurations
# those settings can be configured through new game menu, Config.toml and server command line
# and can be accessed through Server.GetCustomSettings() method from any package
[custom_settings]
# my_toggle = { label = "awesome toggle", type = "boolean", description = "press this!", default = true }
12 changes: 6 additions & 6 deletions Server/Index.lua
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ Player.Subscribe("Destroy", function (player)
end
end)

Character.Subscribe("WeaponAimModeChanged", function(character, old_state, new_state)
Character.Subscribe("WeaponAimModeChange", function(character, old_state, new_state)
local player = character:GetPlayer()
if (not player) then return end

Expand Down Expand Up @@ -554,11 +554,11 @@ function FinishRound(role_winner)
end

if (role_winner == ROLES.SURVIVOR) then
Package.Log("[Halloween] Round finished! Survivors win!")
Console.Log("[Halloween] Round finished! Survivors win!")
Server.BroadcastChatMessage("Round finished! <blue>Survivors</> Win!")
Events.BroadcastRemote("SurvivorWins", player_mvp:GetName(), player_most_damage:GetName() .. " - " .. value_most_damage, player_most_pumpkins:GetName() .. " - " .. value_most_pumpkins)
else
Package.Log("[Halloween] Round finished! Knights win!")
Console.Log("[Halloween] Round finished! Knights win!")
Server.BroadcastChatMessage("Round finished! <red>Horseless Headless Horseman</> Win!")
Events.BroadcastRemote("KnightWins", player_mvp:GetName(), player_most_damage:GetName() .. " - " .. value_most_damage, player_most_pumpkins:GetName() .. " - " .. value_most_pumpkins)
end
Expand Down Expand Up @@ -714,10 +714,10 @@ function UpdateMatchState(new_state)

HalloweenSettings.entities_spawn()

Package.Log("[Halloween] Warm-up! We have " .. tostring(knight_count) .. " Knights and " .. tostring(player_count - knight_count) .. " Survivors!")
Console.Log("[Halloween] Warm-up! We have " .. tostring(knight_count) .. " Knights and " .. tostring(player_count - knight_count) .. " Survivors!")

elseif (new_state == MATCH_STATES.IN_PROGRESS) then
Package.Log("[Halloween] Round started!")
Console.Log("[Halloween] Round started!")
Server.BroadcastChatMessage("<grey>Round Started!</>")

Halloween.current_knights_special_cooldown = 15
Expand All @@ -730,7 +730,7 @@ function UpdateMatchState(new_state)
Halloween.remaining_time = HalloweenSettings.match_time

elseif (new_state == MATCH_STATES.WAITING_PLAYERS) then
Package.Log("[Halloween] Waiting for players to start the match... Type 'start' here to force start!")
Console.Log("[Halloween] Waiting for players to start the match... Type 'start' here to force start!")
Server.BroadcastChatMessage("<grey>Waiting for players (" .. Player.GetCount() .. "/" .. HalloweenSettings.players_to_start .. ").</>")

ClearServer()
Expand Down

0 comments on commit c8e82cf

Please sign in to comment.