diff --git a/source/gamemodes/prophuntextended/gamemode/__sh_config.lua b/source/gamemodes/prophuntextended/gamemode/__sh_config.lua deleted file mode 100644 index 21d8442..0000000 --- a/source/gamemodes/prophuntextended/gamemode/__sh_config.lua +++ /dev/null @@ -1,259 +0,0 @@ --- Sounds played by members of the losing team at the end of the round. -LOSS_SOUNDS = { - "bot/aw_hell.wav", - "bot/aww_man.wav", - "bot/anyone_see_anything.wav", - "bot/anyone_see_them.wav", - "bot/come_out_and_fight_like_a_man.wav", - "bot/come_out_wherever_you_are.wav", - "bot/he_got_away.wav", - "bot/he_got_away2.wav", - "bot/i_dont_know_where_he_went.wav", - "bot/i_got_nothing.wav", - "bot/nothing_happening_over_here.wav", - "bot/nothing_here.wav", - "bot/nothing_moving_over_here.wav", - "bot/thats_not_good.wav", - "bot/theres_too_many.wav", - "bot/theres_too_many_of_them.wav", - "bot/theyre_all_over_the_place2.wav", - "bot/theyre_everywhere2.wav", - "bot/too_many2.wav", - "bot/what_happened.wav", - "bot/what_have_you_done.wav", - "bot/where_are_they.wav", - "bot/where_are_you_hiding.wav" -} --- Sounds played by members of the winning team at the end of the round. -VICTORY_SOUNDS = { - "bot/and_thats_how_its_done.wav", - "bot/come_to_papa.wav", - "bot/do_not_mess_with_me.wav", - "bot/dropped_him.wav", - "bot/enemy_down.wav", - "bot/enemy_down2.wav", - "bot/good_job_team.wav", - "bot/got_him.wav", - "bot/hes_broken.wav", - "bot/hes_dead.wav", - "bot/hes_done.wav", - "bot/hes_down.wav", - "bot/its_a_party.wav", - "bot/i_am_dangerous.wav", - "bot/i_am_on_fire.wav", - "bot/i_got_more_where_that_came_from.wav", - "bot/i_wasnt_worried_for_a_minute.wav", - "bot/killed_him.wav", - "bot/look_out_brag.wav", - "bot/made_him_cry.wav", - "bot/oh_yea.wav", - "bot/oh_yea2.wav", - "bot/owned.wav", - "bot/ruined_his_day.wav", - "bot/tag_them_and_bag_them.wav", - "bot/thats_the_way_this_is_done.wav", - "bot/that_was_a_close_one.wav", - "bot/that_was_it.wav", - "bot/that_was_the_last_guy.wav", - "bot/that_was_the_last_one.wav", - "bot/they_never_knew_what_hit_them.wav", - "bot/they_will_not_escape.wav", - "bot/they_wont_get_away.wav", - "bot/they_wont_get_away2.wav", - "bot/this_is_my_house.wav", - "bot/took_him_down.wav", - "bot/took_him_out.wav", - "bot/took_him_out2.wav", - "bot/wasted_him.wav", - "bot/way_to_be_team.wav", - "bot/well_done.wav", - "bot/we_owned_them.wav", - "bot/whew_that_was_close.wav", - "bot/whoo.wav", - "bot/whoo2.wav", - "bot/whos_the_man.wav", - "bot/who_wants_some_more.wav", - "bot/yesss.wav", - "bot/yesss2.wav" -} --- Taunts played when Hunters hit their Spare1 binding. -HUNTER_TAUNTS = { - "bot/a_bunch_of_them.wav", - "bot/come_out_and_fight_like_a_man.wav", - "bot/come_out_wherever_you_are.wav", - "bot/come_to_papa.wav", - "bot/dont_worry_hell_get_it.wav", - "bot/hang_on_i_heard_something.wav", - "bot/hang_on_im_coming.wav", - "bot/i_dont_think_so.wav", - "bot/i_have_the_hostages.wav", - "bot/i_see_our_target.wav", - "bot/im_waiting_here.wav", - "bot/keeping_an_eye_on_the_hostages.wav", - "bot/nnno_sir.wav", - "bot/spotted_the_delivery_boy.wav", - "bot/target_acquired.wav", - "bot/target_spotted.wav", - "bot/you_heard_the_man_lets_go.wav" -} --- Taunts played when Props hit their Spare1 binding. -PROP_TAUNTS = { --- "ambient/alarms/apc_alarm_loop1.wav", - "ambient/alarms/apc_alarm_pass1.wav", --- "ambient/alarms/citadel_alert_loop2.wav", --- "ambient/alarms/city_firebell_loop1.wav", --- "ambient/alarms/city_siren_loop2.wav", --- "ambient/alarms/combine_bank_alarm_loop1.wav", --- "ambient/alarms/combine_bank_alarm_loop4.wav", --- "ambient/alarms/klaxon1.wav", - "ambient/alarms/manhack_alert_pass1.wav", - "ambient/alarms/razortrain_horn1.wav", - "ambient/alarms/scanner_alert_pass1.wav", --- "ambient/alarms/siren.wav", --- "ambient/alarms/train_crossing_bell_loop1.wav", - "ambient/alarms/train_horn2.wav", - "ambient/alarms/train_horn_distant1.wav", - "ambient/alarms/warningbell1.wav", --- "ambient/chatter/cb_radio_chatter_1.wav", --- "ambient/chatter/cb_radio_chatter_2.wav", --- "ambient/chatter/cb_radio_chatter_3.wav", - "ambient/energy/whiteflash.wav", - "ambient/intro/alyxremove.wav", - "ambient/intro/logosfx.wav", --- "ambient/levels/labs/teleport_alarm_loop1.wav", - "ambient/levels/launch/1stfiringwarning.wav", - "ambient/levels/launch/rockettakeoffblast.wav", --- "ambient/levels/outland/basealarmloop.wav", --- "ambient/machines/60hzhum.wav", - "ambient/misc/ambulance1.wav", - "ambient/misc/carhonk1.wav", - "ambient/misc/carhonk2.wav", - "ambient/misc/carhonk3.wav", --- "ambient/music/bongo.wav", --- "ambient/music/country_rock_am_radio_loop.wav", --- "ambient/music/cubanmusic1.wav", --- "ambient/music/dustmusic1.wav", --- "ambient/music/dustmusic2.wav", --- "ambient/music/dustmusic3.wav", --- "ambient/music/flamenco.wav", --- "ambient/music/latin.wav", --- "ambient/music/mirame_radio_thru_wall.wav", --- "ambient/music/piano1.wav", --- "ambient/music/piano2.wav", - "ambient/outro/gunshipcrash.wav", - "ambient/3dmeagle.wav", --- "ambient/guit1.wav", --- "ambient/opera.wav", --- "ambient/sheep.wav", - "beams/beamstart5.wav", - "buttons/bell1.wav", - "buttons/weapon_cant_buy.wav", - "common/bass.wav", - "common/bugreporter_failed.wav", - "common/warning.wav", - "doors/door_squeek1.wav", - "friends/friend_join.wav", - "friends/friend_online.wav", - "friends/message.wav", - "hostage/hunuse/comeback.wav", - "hostage/hunuse/dontleaveme.wav", - "hostage/hunuse/yeahillstay.wav", - "items/gift_drop.wav", - "music/radio1.mp3", - "phx/eggcrack.wav", - "plats/elevbell1.wav", - "player/headshot1.wav", - "player/headshot2.wav", - "player/sprayer.wav", - "radio/enemydown.wav", - "radio/go.wav", - "radio/locknload.wav", - "radio/negative.wav", - "radio/rounddraw.wav", - "radio/takepoint.wav", - "resource/warning.wav", --- "test/temp/soundscape_test/tv_music.wav", - "ui/achievement_earned.wav", - "ui/freeze_cam.wav", - "vehicles/junker/radar_ping_friendly1.wav", - "weapons/c4/c4_beep1.wav", - "weapons/c4/c4_click.wav", - "weapons/awp/awp1.wav", - "vo/canals/female01/gunboat_giveemhell.wav", - "vo/canals/female01/gunboat_justintime.wav", - "vo/canals/female01/stn6_incoming.wav", - "vo/canals/male01/gunboat_giveemhell.wav", - "vo/canals/male01/gunboat_justintime.wav", - "vo/canals/male01/stn6_incoming.wav", - "vo/canals/al_radio_stn6.wav", - "vo/canals/arrest_getgoing.wav", - "vo/canals/arrest_helpme.wav", - "vo/canals/arrest_lookingforyou.wav", - "vo/canals/boxcar_lethimhelp.wav", - "vo/canals/matt_closecall.wav", - "vo/canals/premassacre.wav", - "vo/ravenholm/aimforhead.wav", - "vo/ravenholm/bucket_patience.wav", - "vo/ravenholm/madlaugh01.wav", - "vo/ravenholm/madlaugh02.wav", - "vo/ravenholm/madlaugh03.wav", - "vo/ravenholm/madlaugh04.wav", - "weapons/strider_buster/ol12_stickybombcreator.wav", - "weapons/c4/c4_explode1.wav", - "weapons/357/357_fire2.wav", - "weapons/357/357_fire3.wav", - "weapons/scout/scout_fire-1.wav", - "weapons/smokegrenade/sg_explode.wav", - "weapons/grenade_launcher1.wav", - "weapons/explode3.wav", - "weapons/underwater_explode3.wav", - "items/nvg_on.wav", - "hostage/huse/letsdoit.wav", - "hostage/huse/illfollow.wav", - "hostage/huse/getouttahere.wav", - "doors/door_screen_move1.wav", - "doors/heavy_metal_stop1.wav", - "doors/default_move.wav", - "common/stuck2.wav", - "ambient/water_splash1.wav", - "ambient/water_splash2.wav", - "ambient/water_splash3.wav", - "ambient/weather/thunder1.wav", - "ambient/weather/thunder2.wav", - "ambient/weather/thunder3.wav", - "ambient/weather/thunder4.wav", - "ambient/weather/thunder5.wav", - "ambient/weather/thunder6.wav", - "ambient/outro/thunder7.wav", - "ambient/voices/crying_loop1.wav", - "ambient/voices/playground_memory.wav", - "ambient/voices/f_scream1.wav", - "ambient/voices/m_scream1.wav", - "ambient/voices/cough1.wav", - "ambient/voices/cough2.wav", - "ambient/voices/cough3.wav", - "ambient/voices/cough4.wav", - "ambient/overhead/plane1.wav", - "ambient/overhead/plane2.wav", - "ambient/overhead/plane3.wav", - "ambient/overhead/hel1.wav", - "ambient/overhead/hel2.wav", - "ambient/misc/truck_backup1.wav", - "ambient/misc/truck_drive1.wav", - "ambient/misc/truck_drive2.wav", - "ambient/machines/pneumatic_drill_1.wav", - "ambient/machines/pneumatic_drill_2.wav", - "ambient/machines/pneumatic_drill_3.wav", - "ambient/machines/pneumatic_drill_4.wav", - "ambient/machines/station_train_squeel.wav", - "ambient/machines/ticktock.wav", - "ambient/creatures/teddy.wav", - "ambient/creatures/town_child_scream1.wav", - "ambient/creatures/town_moan1.wav", - "ambient/creatures/town_muffled_cry1.wav", - "ambient/creatures/town_scared_breathing1.wav", - "ambient/creatures/town_scared_breathing2.wav", - "ambient/creatures/town_scared_sob1.wav", - "ambient/creatures/town_scared_sob2.wav", - "ambient/creatures/town_zombie_call1.wav" -} \ No newline at end of file diff --git a/source/gamemodes/prophuntextended/gamemode/server/config.lua b/source/gamemodes/prophuntextended/gamemode/server/config.lua deleted file mode 100644 index 04e5900..0000000 --- a/source/gamemodes/prophuntextended/gamemode/server/config.lua +++ /dev/null @@ -1,549 +0,0 @@ ---[[ - The MIT License (MIT) - - Copyright (c) 2015 Xaymar - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. ---]] - ---! Initialize configuration table. -GM.Config = { } -GM.Config.ConVars = {} - --- ------------------------------------------------------------------------- -- ---! Basic Settings --- ------------------------------------------------------------------------- -- --- Debug Mode -GM.Config.ConVars.Debug = CreateConVar("ph_debug", 0, FCVAR_CHEAT + FCVAR_REPLICATED) -function GM.Config:Debug() - return self.ConVars.Debug:GetBool() -end - --- Game Mode (See sh_init.lua) -GM.Config.ConVars.GameMode = CreateConVar("ph_gamemode", GM.Modes.Original, FCVAR_REPLICATED) -function GM.Config:GameMode() - return self.ConVars.GameMode:GetInt() -end - --- Timelimit in minutes -GM.Config.ConVars.TimeLimit = GetConVar("mp_timelimit") -function GM.Config:TimeLimit() - return self.ConVars.TimeLimit:GetFloat() -end - --- Enable Sprinting? -GM.Config.ConVars.Sprinting = CreateConVar("ph_sprinting", 0, FCVAR_REPLICATED) -function GM.Config:Sprinting() - return self.ConVars.Sprinting:GetBool() -end - --- Taunt Cooldown (Seconds) -GM.Config.ConVars.TauntCoolDown = CreateConVar("ph_tauntcooldown", 5, FCVAR_REPLICATED) -function GM.Config:TauntCoolDown() - return self.ConVars.TauntCoolDown:GetFloat() -end - --- ------------------------------------------------------------------------- -- ---! Round Settings --- ------------------------------------------------------------------------- -- -GM.Config.Round = {} -GM.Config.Round.ConVars = {} - --- How many rounds should the gamemode attempt to fit into the map timelimit, if there is any? -GM.Config.Round.ConVars.Amount = CreateConVar("ph_round_limit", 10, FCVAR_REPLICATED) -function GM.Config.Round:Amount() - return self.ConVars.Amount:GetInt() -end - --- Round Time Limit (Seconds, Default 3 minutes) -GM.Config.Round.ConVars.Time = CreateConVar("ph_round_timelimit", 180, FCVAR_REPLICATED) -function GM.Config.Round:Time() - return self.ConVars.Time:GetInt() - GAMEMODE.Config.Round:BlindTime() -end - --- For how many seconds are the Seekers blinded? (Seconds) -GM.Config.Round.ConVars.BlindTime = CreateConVar("ph_round_blindtime", 30, FCVAR_REPLICATED, "How long are hunters blinded? (positive values will be inside the round time limit, negative will add to the round time limit)") -function GM.Config.Round:BlindTime() - return self.ConVars.BlindTime:GetInt() -end - --- ------------------------------------------------------------------------- -- ---! Seeker Settings --- ------------------------------------------------------------------------- -- -GM.Config.Seeker = {} -GM.Config.Seeker.ConVars = {} - -GM.Config.Seeker.ConVars.Health = CreateConVar("ph_seeker_health", 100, FCVAR_REPLICATED) -function GM.Config.Seeker:Health() - return self.ConVars.Health:GetInt() -end - -GM.Config.Seeker.ConVars.HealthMax = CreateConVar("ph_seeker_health_max", 100, FCVAR_REPLICATED) -function GM.Config.Seeker:HealthMax() - return self.ConVars.HealthMax:GetInt() -end - -GM.Config.Seeker.ConVars.HealthBonus = CreateConVar("ph_seeker_health_bonus", 20, FCVAR_REPLICATED) -function GM.Config.Seeker:HealthBonus() - return self.ConVars.HealthBonus:GetInt() -end - -GM.Config.Seeker.ConVars.HealthPenalty = CreateConVar("ph_seeker_health_penalty", 5, FCVAR_REPLICATED) -function GM.Config.Seeker:HealthPenalty() - return self.ConVars.HealthPenalty:GetInt() -end - -GM.Config.Seeker.ConVars.Weapons = CreateConVar("ph_seeker_weapons", "weapon_crowbar,weapon_pistol,weapon_ph_smg,weapon_shotgun", FCVAR_REPLICATED) -function GM.Config.Seeker:Weapons() - return string.Split(self.ConVars.Weapons:GetString(), ",") -end - -GM.Config.Seeker.ConVars.Ammo = CreateConVar("ph_seeker_ammo", "Pistol:100,SMG1:300,SMG1_Grenade:1,Buckshot:64", FCVAR_REPLICATED) -function GM.Config.Seeker:Ammo() - return string.Split(self.ConVars.Ammo:GetString(), ",") -end - --- ------------------------------------------------------------------------- -- ---! Hider Settings --- ------------------------------------------------------------------------- -- -GM.Config.Hider = {} -GM.Config.Hider.ConVars = {} - -GM.Config.Hider.ConVars.Health = CreateConVar("ph_hider_health", 100, FCVAR_REPLICATED) -function GM.Config.Hider:Health() - return self.ConVars.Health:GetInt() -end - -GM.Config.Hider.ConVars.HealthMax = CreateConVar("ph_hider_health_max", 100, FCVAR_REPLICATED) -function GM.Config.Hider:HealthMax() - return self.ConVars.HealthMax:GetInt() -end - -GM.Config.Hider.ConVars.HealthScaling = CreateConVar("ph_hider_health_scaling", 100, FCVAR_REPLICATED) -function GM.Config.Hider:HealthScaling() - return self.ConVars.HealthScaling:GetBool() -end - -GM.Config.Hider.ConVars.HealthScalingMax = CreateConVar("ph_hider_health_scaling_max", 200, FCVAR_REPLICATED) -function GM.Config.Hider:HealthScalingMax() - return self.ConVars.HealthScalingMax:GetInt() -end - --- ------------------------------------------------------------------------- -- ---! Whitelist & Blacklist --- ------------------------------------------------------------------------- -- -GM.Config.Lists = {} -GM.Config.Lists.ConVars = {} -GM.Config.Lists.ConCmds = {} - -GM.Config.Lists.ConVars.ClassWhitelist = CreateConVar("ph_list_class_whitelist", "prop_physics,prop_physics_multiplayer,prop_physics_respawnable", FCVAR_REPLICATED) -function GM.Config.Lists:ClassWhitelist() - return string.Split(self.ConVars.ClassWhitelist:GetString(), ",") -end - --- Use Abuse Blacklist -GM.Config.Lists.ConVars.AbuseBlacklist = CreateConVar("ph_list_abuse_blacklist", "func_button,func_door,func_door_rotation,prop_door_rotation,func_tracktrain,func_tanktrain,func_breakable", FCVAR_REPLICATED) -function GM.Config.Lists:AbuseBlacklist() - return string.Split(self.ConVars.AbuseBlacklist:GetString(), ",") -end - --- Model Blacklist -GM.Config.Lists.ModelBlacklist = {} -GM.Config.Lists.ModelBlacklist["models/props/cs_assault/dollar.mdl"] = true -GM.Config.Lists.ModelBlacklist["models/props/cs_assault/money.mdl"] = true -GM.Config.Lists.ModelBlacklist["models/props/cs_office/snowman_arm.mdl"] = true -GM.Config.Lists.ModelBlacklist["models/props/cs_office/projector_remote.mdl"] = true ---GM.Config.Lists.ModelBlacklist["models/props_junk/garbage_plasticbottle001a.mdl"] = true - -GM.Config.Lists.ConCmds.ModelBlacklistList = concommand.Add("ph_list_model_blacklist_list", function(ply, cmd, args, argStr) - print("Model Blacklist:") - for k,v in pairs(GAMEMODE.Config.Lists.ModelBlacklist) do - print(" "..k) - end -end, "List all blacklisted models.") - -GM.Config.Lists.ConCmds.ModelBlacklistClear = concommand.Add("ph_list_model_blacklist_list", function(ply, cmd, args, argStr) - GM.Config.Lists.ModelBlacklist = {} -end, "Clear blacklisted models.") - -GM.Config.Lists.ConCmds.ModelBlacklistAdd = concommand.Add("ph_list_model_blacklist_add", function(ply, cmd, args, argStr) - if (table.count(args) > 0) then - GAMEMODE.Config.Lists.ModelBlacklist[args[1]] = true - else - print("Missing model name") - end -end, "Add a new blacklisted model.") - -GM.Config.Lists.ConCmds.ModelBlacklistRemove = concommand.Add("ph_list_model_blacklist_remove", function(ply, cmd, args, argStr) - if (table.count(args) > 0) then - GAMEMODE.Config.Lists.ModelBlacklist[args[1]] = nil - else - print("Missing model name") - end -end, "Removes a blacklisted model.") - --- ------------------------------------------------------------------------- -- ---! Taunts --- ------------------------------------------------------------------------- -- --- GM.Config.Taunts = { - -- Seeker = { }, - -- Hider = { }, --- } - --- -- Taunts.Clear() --- --@desc: Clears the current taunt list. --- GM.Config.Taunts.Clear = function() - -- this.Seeker = {} - -- this.Hider = {} --- end - --- -- Taunts.Load(sTauntListFile) --- --@desc: Loads the taunt list from disk. --- --@param: --- -- sTauntListFile - A string containing the path to the taunt list to load. --- --@return: true or false depending on success. --- GM.Config.Taunts.Load = function(sTauntListFile) - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Load: Loading taunt list from file '"..sTauntListFile.."'...") end - - -- -- Safeguard against idiots. - -- if type(sTauntListFile) != "string" then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Load: is not a string.") end - -- return false - -- end - - -- -- Given file must exist for us to continue. - -- if ! file.Exists(sTauntListFile, "GAME") then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Load: File not found.") end - -- return false - -- end - - -- -- Read the file and check if it's empty. - -- sTauntListData = file.Read(sTauntListFile, "GAME") - -- if sTauntListData == "" then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Load: File is empty.") end - -- return false - -- end - - -- -- Convert JSON to a table for us to use. - -- sTauntList = util.JSONToTable(sTauntListData) - - -- -- Is it nil? Then it's not valid JSON - -- if sTauntList == nil then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Load: File contains invalid JSON.") end - -- return false - -- end - - -- -- Finally, append the taunt lists. - -- if sTauntList.Seeker != nil then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Load: Adding Seeker taunts...") end - -- for k,v in pairs(sTauntList.Seeker) do - -- GAMEMODE.Taunts.Seeker[k] = v - -- end - -- end - -- if sTauntList.Hider != nil then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Load: Adding Hider taunts...") end - -- for k,v in pairs(sTauntList.Hider) do - -- GAMEMODE.Taunts.Hider[k] = v - -- end - -- end - - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Load: Complete.") end - -- return true --- end - --- -- Taunts.Save(sTauntListFile) --- --@desc: Saves the current taunt list to disk. --- --@param: --- -- sTauntListFile - A string containing the path to the file to save to. --- --@return: true or false depending on success. --- GM.Config.Taunts.Save = function(sTauntListFile) - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Save: Saving taunt list to file '"..sTauntListFile.."'...") end - - -- -- Safeguard against idiots. - -- if type(sTauntListFile) != "string" then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Save: is not a string.") end - -- return false - -- end - - -- -- File must not be nil, otherwise we can't write to it. - -- if sTauntListFile == nil then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Save: No file given.") end - -- return false - -- end - - -- -- Convert our taunt table to JSON. - -- sTauntListData = util.TableToJSON(GAMEMODE.Taunts); - -- if sTauntListData == nil then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Save: Corrupted GAMEMODE table.") end - -- return false - -- end - - -- -- Write out JSON out to file - -- if ! file.Write(sTauntListFile, sTauntListData) then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Save: Failed to write to file.") end - -- return false - -- end - - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Save: Complete.") end - -- return true --- end - --- -- Taunts.Add(sTauntName, sSoundFile, iTeamID, mPropFilter) --- --@desc: Registers a new taunt with the given name, file, team and filter. --- --@param: --- -- sTauntName - The unique name of the taunt. --- -- sSoundFile - A sound file to play when this taunt is selected. --- -- iTeamID - The team that should receive the taunt or nil for all teams. --- -- mPropFilter - A string or a table containing strings for props that should be able to use this taunt. --- --@return: true or false depending on success. --- GM.Config.Taunts.Add = function(sTauntName, sSoundFile, iTeamID, mPropFilter) - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Add: Adding new taunt '"..sTauntName.."'...") end - - -- -- Safeguard against idiots. - -- if type(sTauntName) != "string" then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Add: is not a string.") end - -- return false - -- end - -- if type(sSoundFile) != "string" then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Add: is not a string.") end - -- return false - -- end - -- if (type(iTeamID) != "number" && iTeamID != nil) then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Add: is not a number or nil.") end - -- return false - -- end - -- if (type(mPropFilter) != "string" && type(mPropFilter) != "table" && mPropFilter != nil) then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Add: is not a string, table or nil.") end - -- return false - -- end - - -- -- Check if the sound file actually exists - -- if !file.Exists("sound/"..sSoundFile, "GAME") then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Add: File '"..sSoundFile.."' does not exist.") end - -- return false - -- end - - -- -- Make sure that our prop filter is a table listing the props it's supposed to work for. - -- if (mPropFilter == nil) then - -- mPropFilter = { } - -- elseif type(mPropFilter) == "string" then - -- mPropFilter = { mPropFilter } - -- end - - -- -- Prepare Taunt table - -- Taunt = { - -- File = sSoundFile, - -- Filter = mPropFilter - -- } - - -- -- If iTeamID is nil, both teams will receive the taunt. - -- if iTeamID == nil then - -- GAMEMODE.Taunts.Seeker[sTauntName] = Taunt - -- GAMEMODE.Taunts.Hider[sTauntName] = Taunt - -- else - -- -- Make sure that the team is valid. - -- if ! team.Valid(iTeamID) then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Add: Team "..iTeamID.."' does not exist.") end - -- return false - -- end - - -- if (iTeamID == TEAM_SEEKERS) then - -- GAMEMODE.Taunts.Seeker[sTauntName] = Taunt - -- elseif (iTeamID == TEAM_HIDERS) then - -- GAMEMODE.Taunts.Hider[sTauntName] = Taunt - -- else - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Add: Team "..iTeamID.."' can't have taunts.") end - -- return false - -- end - -- end - - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Add: Complete.") end - -- return true --- end - --- -- Taunts.Remove(sTauntName, iTeamID) --- --@desc: Removes a registered taunt with the given name and team. --- --@param: --- -- sTauntName - The unique name of the taunt. --- -- iTeamID - The team that the taunt should be removed from or nil for all teams. --- --@return: true or false depending on success. --- GM.Config.Taunts.Remove = function(sTauntName, iTeamID) - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Remove: Removing taunt '"..sTauntName.."'...") end - - -- -- Safeguard against idiots. - -- if type(sTauntName) != "string" then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Remove: is not a string.") end - -- return false - -- end - -- if (type(iTeamID) != "number" && iTeamID != nil) then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Remove: is not a number or nil.") end - -- return false - -- end - - -- -- if iTeamID is nil, both teams will have the taunt removed. - -- if (iTeamID == nil) then - -- GAMEMODE.Taunts.Seeker[sTauntName] = nil - -- GAMEMODE.Taunts.Hider[sTauntName] = nil - -- else - -- -- Make sure we have a valid Team. - -- if ! team.Valid(iTeamID) then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Remove: Team "..iTeamID.."' does not exist.") end - -- return false - -- end - - -- if iTeamID == TEAM_SEEKERS then - -- GAMEMODE.Taunts.Seeker[sTauntName] = nil - -- elseif iTeamID == TEAM_HIDERS then - -- GAMEMODE.Taunts.Hider[sTauntName] = nil - -- else - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Remove: Team "..iTeamID.."' can't have taunts.") end - -- return false - -- end - -- end - - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Taunts.Remove: Complete.") end - -- return true --- end - --- -- ToDo: Taunts.Get(iTeamID, sPropName) - --- --! Announcers (Round Start, Unblind, Win, Loss) --- GM.Config.Announcers = { - -- Start = { }, - -- Unblind = { }, - -- Win = { }, - -- Loss = { } --- } - --- -- Announcers.Clear() --- --@desc: Clears the current announcer list. --- GM.Config.Announcers.Clear = function() - -- Announcers.Start = { } - -- Announcers.Unblind = { } - -- Announcers.Win = { } - -- Announcers.Loss = { } --- end - --- -- Announcers.Load(sAnnouncerListFile) --- --@desc: Tries to load the given announcer list. --- --@param: --- -- sAnnouncerListFile - A string containing the path to the announcer list to load. --- --@return: true or false depending on success. --- GM.Config.Announcers.Load = function(sAnnouncerListFile) - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Load: Loading announcer list from file '"..sAnnouncerListFile.."'...") end - - -- -- Safeguard against idiots. - -- if type(sAnnouncerListFile) != "string" then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Load: is not a string.") end - -- return false - -- end - - -- -- Given file must exist for us to continue. - -- if ! file.Exists(sAnnouncerListFile, "GAME") then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Load: File not found.") end - -- return false - -- end - - -- -- Read the file and check if it's empty. - -- sAnnouncerListData = file.Read(sAnnouncerListFile, "GAME") - -- if sAnnouncerListData == "" then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Load: File is empty.") end - -- return false - -- end - - -- -- Convert JSON to a table for us to use. - -- sAnnouncerList = util.JSONToTable(sAnnouncerListData) - - -- -- Is it nil? Then it's not valid JSON - -- if sAnnouncerList == nil then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Load: File contains invalid JSON.") end - -- return false - -- end - - -- -- Finally, insert the announcer lists. - -- if sAnnouncerList.Start != nil then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Load: Adding Start announcers...") end - -- for k,v in pairs(sAnnouncerList.Start) do - -- GAMEMODE.Announcers.Start[k] = v - -- end - -- end - -- if sAnnouncerList.Unblind != nil then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Load: Adding Unblind announcers...") end - -- for k,v in pairs(sAnnouncerList.Unblind) do - -- GAMEMODE.Announcers.Unblind[k] = v - -- end - -- end - -- if sAnnouncerList.Win != nil then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Load: Adding Win announcers...") end - -- for k,v in pairs(sAnnouncerList.Win) do - -- GAMEMODE.Announcers.Win[k] = v - -- end - -- end - -- if sAnnouncerList.Loss != nil then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Load: Adding Loss announcers...") end - -- for k,v in pairs(sAnnouncerList.Loss) do - -- GAMEMODE.Announcers.Loss[k] = v - -- end - -- end - - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Load: Complete.") end - -- return true --- end - --- -- Announcers.Save(sAnnouncerListFile) --- --@desc: Saves the current taunt list to disk. --- --@param: --- -- sAnnouncerListFile - A string containing the path to the file to save to. --- --@return: true or false depending on success. --- GM.Config.Announcers.Save = function(sAnnouncerListFile) - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Save: Saving announcer list to file '"..sAnnouncerListFile.."'...") end - - -- -- Safeguard against idiots. - -- if type(sAnnouncerListFile) != "string" then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Save: is not a string.") end - -- return false - -- end - - -- -- File must not be nil, otherwise we can't write to it. - -- if sAnnouncerListFile == nil then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Save: No file given.") end - -- return false - -- end - - -- -- Convert our taunt table to JSON. - -- sAnnouncerListData = util.TableToJSON(GAMEMODE.Announcers); - -- if sAnnouncerListData == nil then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Save: Corrupted GAMEMODE table.") end - -- return false - -- end - - -- -- Write out JSON out to file - -- if ! file.Write(sAnnouncerListFile, sAnnouncerListData) then - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Save: Failed to write to file.") end - -- return false - -- end - - - -- if GAMEMODE.Config:Debug() then print("Prop Hunt.Announcers.Save: Complete.") end - -- return true --- end - --- -- ToDo: Announcers.Add --- -- ToDo: Announcers.Remove --- -- ToDo: Announcers.Get(iType)