From 6640c669afa9c6d56f0475d7e5a5d6cf0b4b2666 Mon Sep 17 00:00:00 2001 From: "theastropath@gmail.com" Date: Wed, 24 May 2023 14:10:44 -0400 Subject: [PATCH] Update CS file for Crowd Control 2.0 compatibility. Allow effect durations to be pulled from the Crowd Control message and used. Updated OfflineCrowdControl to send randomized durations (mostly for testing purposes, but you know... just in case?) --- Classes/UT99CCEffects.uc | 147 +++++++++++++++++---------- Classes/UT99CrowdControlLink.uc | 8 +- OfflineCrowdControl.py | 4 + UT99.cs | 173 ++++++++++++++++++-------------- 4 files changed, 199 insertions(+), 133 deletions(-) diff --git a/Classes/UT99CCEffects.uc b/Classes/UT99CCEffects.uc index 277ddca..8fd8152 100644 --- a/Classes/UT99CCEffects.uc +++ b/Classes/UT99CCEffects.uc @@ -487,6 +487,8 @@ function AddItemToPawnInventory(Pawn p, Inventory item) { item.SetOwner(p); item.Inventory = p.Inventory; + item.bHeldItem=True; + item.RespawnTime=0.0; p.Inventory = item; } @@ -553,15 +555,15 @@ function class GetWeaponClassByName(String weaponName) } function Weapon GiveWeaponToPawn(Pawn PlayerPawn, class WeaponClass, optional bool bBringUp) { - local Weapon NewWeapon; + local Weapon NewWeapon; local Inventory inv; inv = PlayerPawn.FindInventoryType(WeaponClass); if (inv != None ) { - newWeapon = Weapon(inv); - newWeapon.GiveAmmo(PlayerPawn); - return newWeapon; - } + newWeapon = Weapon(inv); + newWeapon.GiveAmmo(PlayerPawn); + return newWeapon; + } newWeapon = Spawn(WeaponClass); if ( newWeapon != None ) { @@ -573,9 +575,9 @@ function Weapon GiveWeaponToPawn(Pawn PlayerPawn, class WeaponClass, opt newWeapon.WeaponSet(PlayerPawn); newWeapon.AmbientGlow = 0; if ( PlayerPawn.IsA('PlayerPawn') ) - newWeapon.SetHand(PlayerPawn(PlayerPawn).Handedness); + newWeapon.SetHand(PlayerPawn(PlayerPawn).Handedness); else - newWeapon.GotoState('Idle'); + newWeapon.GotoState('Idle'); if ( bBringUp ) { PlayerPawn.Weapon.GotoState('DownWeapon'); PlayerPawn.PendingWeapon = None; @@ -1139,10 +1141,15 @@ function SetAllPlayersBehindView(bool val) } } -function int ThirdPerson(String viewer) +function int ThirdPerson(String viewer, int duration) { SetAllPlayersBehindView(True); - behindTimer = BehindTimerDefault; + + if (duration==0){ + duration = BehindTimerDefault; + } + + behindTimer = duration; Broadcast(viewer$" wants you to have an out of body experience!"); @@ -1163,30 +1170,37 @@ function int GiveDamageItem(String viewer) return Success; } -function int FullFat(String viewer) +function int FullFat(String viewer, int duration) { if (fatnessTimer>0) { return TempFail; } SetAllPlayersFatness(255); - - fatnessTimer = FatnessTimerDefault; + + if (duration==0){ + duration = FatnessTimerDefault; + } + + fatnessTimer = duration; bFat=True; Broadcast(viewer$" fattened everybody up!"); return Success; } -function int SkinAndBones(String viewer) +function int SkinAndBones(String viewer, int duration) { if (fatnessTimer>0) { return TempFail; } SetAllPlayersFatness(1); - - fatnessTimer = FatnessTimerDefault; + + if (duration==0){ + duration = FatnessTimerDefault; + } + fatnessTimer = duration; bFat=False; Broadcast(viewer$" made everyone really skinny!"); @@ -1194,15 +1208,17 @@ function int SkinAndBones(String viewer) } -function int GottaGoFast(String viewer) +function int GottaGoFast(String viewer, int duration) { if (speedTimer>0) { return TempFail; } SetAllPlayersGroundSpeed(class'TournamentPlayer'.Default.GroundSpeed * 3); - - speedTimer = SpeedTimerDefault; + if (duration==0){ + duration = SpeedTimerDefault; + } + speedTimer = duration; bFast=True; targetPlayer=""; Broadcast(viewer$" made everyone fast like Sonic!"); @@ -1210,7 +1226,7 @@ function int GottaGoFast(String viewer) return Success; } -function int GottaGoSlow(String viewer) +function int GottaGoSlow(String viewer, int duration) { if (speedTimer>0) { return TempFail; @@ -1218,7 +1234,10 @@ function int GottaGoSlow(String viewer) SetAllPlayersGroundSpeed(class'TournamentPlayer'.Default.GroundSpeed / 3); - speedTimer = SlowTimerDefault; + if (duration==0){ + duration = SlowTimerDefault; + } + speedTimer = duration; bFast=False; targetPlayer=""; Broadcast(viewer$" made everyone slow like a snail!"); @@ -1379,6 +1398,8 @@ function int DropSelectedWeapon(string viewer) { if (IsWeaponRemovable(p.Weapon)){ w=p.Weapon; p.DeleteInventory(p.Weapon); + w.bHidden=True; + //w.bDeleteMe=True; w.Destroy(); } } @@ -1412,31 +1433,39 @@ function int GiveWeapon(String viewer, String weaponName) -function int EnableIcePhysics(string viewer) +function int EnableIcePhysics(string viewer, int duration) { if (iceTimer>0) { return TempFail; } + + if (duration==0){ + duration = IceTimerDefault; + } + Broadcast(viewer@"made the ground freeze!"); SetIcePhysics(True); - iceTimer = IceTimerDefault; + iceTimer = duration; return Success; } -function int EnableMoonPhysics(string viewer) +function int EnableMoonPhysics(string viewer, int duration) { if (gravityTimer>0) { return TempFail; } + if (duration==0){ + duration = GravityTimerDefault; + } Broadcast(viewer@"reduced gravity!"); SetMoonPhysics(True); - gravityTimer = GravityTimerDefault; + gravityTimer = duration; return Success; } -function int StartMeleeOnlyTime(String viewer) +function int StartMeleeOnlyTime(String viewer, int duration) { if (meleeTimer > 0) { return TempFail; @@ -1447,14 +1476,16 @@ function int StartMeleeOnlyTime(String viewer) ForceAllPawnsToMelee(); Broadcast(viewer@"requests melee weapons only!"); - - meleeTimer = MeleeTimerDefault; + if (duration==0){ + duration = MeleeTimerDefault; + } + meleeTimer = duration; return Success; } -function int StartFlood(string viewer) +function int StartFlood(string viewer, int duration) { if (floodTimer>0) { return TempFail; @@ -1463,7 +1494,10 @@ function int StartFlood(string viewer) SetFlood(True); UpdateAllPawnsSwimState(); - floodTimer = FloodTimerDefault; + if (duration==0){ + duration = FloodTimerDefault; + } + floodTimer = duration; return Success; } @@ -1504,7 +1538,7 @@ function int LastPlaceDamage(String viewer) } -function int FirstPlaceSlow(String viewer) +function int FirstPlaceSlow(String viewer, int duration) { local Pawn p; @@ -1519,8 +1553,11 @@ function int FirstPlaceSlow(String viewer) } p.GroundSpeed = (class'TournamentPlayer'.Default.GroundSpeed / 3); - - speedTimer = SingleSlowTimerDefault; + + if (duration == 0){ + duration = SingleSlowTimerDefault; + } + speedTimer = duration; targetPlayer=p.PlayerReplicationInfo.PlayerName; Broadcast(viewer$" made "$p.PlayerReplicationInfo.PlayerName$" slow as punishment for being in first place!"); @@ -1608,14 +1645,16 @@ function int SpawnNewBot(String viewer,name Orders) return Success; } -function int StartVampireMode(string viewer) +function int StartVampireMode(string viewer, int duration) { if (vampireTimer>0) { return TempFail; } Broadcast(viewer@"made everyone have a taste for blood!"); - - vampireTimer = VampireTimerDefault; + if (duration==0){ + duration = VampireTimerDefault; + } + vampireTimer = duration; return Success; } @@ -1632,7 +1671,7 @@ function ForceAllPawnsToSpecificWeapon(class weaponClass) } -function int ForceWeaponUse(String viewer, String weaponName) +function int ForceWeaponUse(String viewer, String weaponName, int duration) { local class weaponClass; local Pawn p; @@ -1653,8 +1692,10 @@ function int ForceWeaponUse(String viewer, String weaponName) GiveWeaponToPawn(p,weaponClass); } - - forceWeaponTimer = ForceWeaponTimerDefault; + if (duration==0){ + duration = ForceWeaponTimerDefault; + } + forceWeaponTimer = duration; forcedWeapon = weaponClass; Broadcast(viewer$" forced everybody to use a specific weapon! ("$forcedWeapon.default.ItemName$")"); @@ -1731,7 +1772,7 @@ function int ReturnCTFFlags(String viewer) ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -function int doCrowdControlEvent(string code, string param[5], string viewer, int type) { +function int doCrowdControlEvent(string code, string param[5], string viewer, int type, int duration) { switch(code) { case "sudden_death": //Everyone loses all armour and goes down to one health return SuddenDeath(viewer); @@ -1742,17 +1783,17 @@ function int doCrowdControlEvent(string code, string param[5], string viewer, in case "give_health": //Give an arbitrary amount of health. Allows overhealing, up to 199 return GiveHealth(viewer,Int(param[0])); case "third_person": //Switches to behind view for everyone - return ThirdPerson(viewer); + return ThirdPerson(viewer,duration); case "bonus_dmg": //Gives everyone a damage bonus item (triple damage) return GiveDamageItem(viewer); case "full_fat": //Makes everyone really fat for a minute - return FullFat(viewer); + return FullFat(viewer,duration); case "skin_and_bones": //Makes everyone really skinny for a minute - return SkinAndBones(viewer); + return SkinAndBones(viewer,duration); case "gotta_go_fast": //Makes everyone really fast for a minute - return GottaGoFast(viewer); + return GottaGoFast(viewer, duration); case "gotta_go_slow": //Makes everyone really slow for 15 seconds (A minute was too much!) - return GottaGoSlow(viewer); + return GottaGoSlow(viewer, duration); case "thanos": //Every player has a 50% chance of being killed return ThanosSnap(viewer); case "swap_player_position": //Picks two random players and swaps their positions @@ -1772,19 +1813,19 @@ function int doCrowdControlEvent(string code, string param[5], string viewer, in case "give_redeemer": //This is separate so that it can be priced differently return GiveWeapon(viewer,"WarHeadLauncher"); case "ice_physics": //Makes the floor very slippery (This is kind of stuttery in multiplayer...) for a minute - return EnableIcePhysics(viewer); + return EnableIcePhysics(viewer, duration); case "low_grav": //Makes the world entirely low gravity for a minute - return EnableMoonPhysics(viewer); + return EnableMoonPhysics(viewer, duration); case "melee_only": //Force everyone to use melee for the duration (continuously check weapon and switch to melee choice) - return StartMeleeOnlyTime(viewer); + return StartMeleeOnlyTime(viewer,duration); case "flood": //Make the entire map a water zone for a minute! - return StartFlood(viewer); + return StartFlood(viewer, duration); case "last_place_shield": //Give last place player a shield belt return LastPlaceShield(viewer); case "last_place_bonus_dmg": //Give last place player a bonus damage item return LastPlaceDamage(viewer); case "first_place_slow": //Make the first place player really slow - return FirstPlaceSlow(viewer); + return FirstPlaceSlow(viewer, duration); case "blue_redeemer_shell": //Blow up first place player return BlueRedeemerShell(viewer); case "spawn_a_bot_attack": //Summon a bot that attacks, then disappears after a death @@ -1792,13 +1833,13 @@ function int doCrowdControlEvent(string code, string param[5], string viewer, in case "spawn_a_bot_defend": //Summon a bot that defends, then disappears after a death return SpawnNewBot(viewer,'Defend'); case "vampire_mode": //Inflicting damage heals you for the damage dealt (Can grab damage via MutatorTakeDamage) - return StartVampireMode(viewer); + return StartVampireMode(viewer, duration); case "force_weapon_use": //Give everybody a weapon, then force them to use it for the duration. Ammo tops up if run out - return ForceWeaponUse(viewer,param[0]); + return ForceWeaponUse(viewer,param[0],duration); case "force_instagib": //Give everybody an enhanced shock rifle, then force them to use it for the duration. Ammo tops up if run out - return ForceWeaponUse(viewer,"SuperShockRifle"); + return ForceWeaponUse(viewer,"SuperShockRifle",duration); case "force_redeemer": //Give everybody a redeemer, then force them to use it for the duration. Ammo tops up if run out - return ForceWeaponUse(viewer,"WarHeadLauncher"); + return ForceWeaponUse(viewer,"WarHeadLauncher",duration); case "reset_domination_control_points": return ResetDominationControlPoints(viewer); case "return_ctf_flags": diff --git a/Classes/UT99CrowdControlLink.uc b/Classes/UT99CrowdControlLink.uc index 8e4091b..60b81e1 100644 --- a/Classes/UT99CrowdControlLink.uc +++ b/Classes/UT99CrowdControlLink.uc @@ -22,6 +22,7 @@ const CrowdControlPort = 43384; const ReconDefault = 5; +const MILLISEC_TO_SEC=1000; function Init(CrowdControl cc, string addr) { @@ -93,7 +94,7 @@ function MutatorTakeDamage( out int ActualDamage, Pawn Victim, Pawn InstigatedBy function handleMessage(string msg) { - local int id,type; + local int id,type, duration; local string code,viewer; local string param[5]; @@ -108,12 +109,15 @@ function handleMessage(string msg) { viewer = jmsg.get("viewer"); id = int(jmsg.get("id")); type = int(jmsg.get("type")); + duration = int(jmsg.get("duration")); //This comes through in milliseconds (If not present, this will give 0) + duration = duration/MILLISEC_TO_SEC; //Make it be in seconds + // maybe a little cleaner than using get_vals and having to worry about matching the array sizes? for(i=0; i 43384; - public UnrealTournament99(IPlayer player, Func responseHandler, Action statusUpdateHandler) : base(player, responseHandler, statusUpdateHandler) { } + public override ISimpleTCPPack.MessageFormat MessageFormat => ISimpleTCPPack.MessageFormat.CrowdControlLegacy; - public override Game Game { get; } = new Game(90, "Unreal Tournament 99", "UnrealTournament99", "PC", ConnectorType.SimpleTCPConnector); + public UnrealTournament99(UserRecord player, Func responseHandler, Action statusUpdateHandler) : base(player, responseHandler, statusUpdateHandler) { } - public override List Effects => new List + public override Game Game { get; } = new(131, "Unreal Tournament 99", "UnrealTournament99", "PC", ConnectorType.SimpleTCPConnector); + + //Weapon list + private static readonly ParameterDef weaponList = new("Weapons", "weapons", + new Parameter("Translocator", "translocator"), + new Parameter("Ripper", "ripper"), + new Parameter("BioRifle", "biorifle"), + new Parameter("Flak Cannon", "flakcannon"), + new Parameter("Sniper Rifle", "sniperrifle"), + new Parameter("Shock Rifle", "shockrifle"), + new Parameter("Pulse Rifle", "pulsegun"), + new Parameter("Minigun", "minigun"), + new Parameter("Rocket Launcher", "rocketlauncher") + ); + + //Ammo List + private static readonly ParameterDef ammoList = new("Ammo", "ammo", + new Parameter("Flak Ammo", "flakammo"), + new Parameter("BioRifle Goo", "bioammo"), + new Parameter("Redeemer Missile", "warheadammo"), + new Parameter("Pulse Rifle Ammo", "pammo"), + new Parameter("Shock Rifle Core", "shockcore"), + new Parameter("Ripper Blades", "bladehopper"), + new Parameter("Rockets", "rocketpack"), + new Parameter("Sniper Ammo", "bulletbox"), + new Parameter("Minigun/Enforcer Ammo", "miniammo") + ); + + public override EffectList Effects { get; } = new Effect[] { //General Effects - new Effect("Go Third-Person", "third_person"){Price = 10,Description = "Force players to see themselves!",Duration=60}, - new Effect("Full Fat Tournament", "full_fat"){Price = 5,Description = "All players become extremely fat!",Duration=60}, - new Effect("Just Skin and Bones", "skin_and_bones"){Price = 4,Description = "All players become extremely skinny!",Duration=60}, - new Effect("Gotta Go Fast (60 Seconds)", "gotta_go_fast"){Price = 10,Description = "It's extra fast mode!",Duration=60}, - new Effect("Gotta Go Slow (15 Seconds)", "gotta_go_slow"){Price = 10,Description = "It's extra slow mode!",Duration=15}, - new Effect("Swap Two Players Positions", "swap_player_position"){Price = 10,Description = "2 players swap positions on the map!"}, - new Effect("Nudge All Players", "nudge"){Price = 5,Description = "Push the players around!"}, - new Effect("Ice Physics", "ice_physics"){Price = 10,Description = "Summon frosty floors!",Duration=60}, - new Effect("Low Gravity", "low_grav"){Price = 5,Description = "Low gravity means players jump higher!",Duration=60}, - new Effect("Flood the Arena (20 Seconds)", "flood"){Price = 10,Description = "Flood the arena!",Duration=20}, - new Effect("Slow First Place Player", "first_place_slow"){Price = 5,Description = "The first place player is too good, let's punish them!",Duration=45}, - new Effect("Spawn an Attacking Bot (One Death)", "spawn_a_bot_attack"){Price = 10,Description = "This will spawn a bot on whatever team has the least amount of players and will be on the offensive"}, - new Effect("Spawn a Defending Bot (One Death)", "spawn_a_bot_defend"){Price = 10,Description = "This will spawn a bot on whatever team is has the least amount of players with orders to defend their base"}, + new Effect("Go Third-Person", "third_person"){Price = 10, Description = "Force players to see themselves!", Duration=60}, + new Effect("Full Fat Tournament", "full_fat"){Price = 5, Description = "All players become extremely fat!", Duration=60}, + new Effect("Just Skin and Bones", "skin_and_bones"){Price = 4, Description = "All players become extremely skinny!", Duration=60}, + new Effect("Gotta Go Fast", "gotta_go_fast"){Price = 10, Description = "It's extra fast mode!", Duration=60}, + new Effect("Gotta Go Slow", "gotta_go_slow"){Price = 10, Description = "It's extra slow mode!", Duration=15}, + new Effect("Swap Two Players Positions", "swap_player_position"){Price = 10, Description = "2 players swap positions on the map!"}, + new Effect("Nudge All Players", "nudge"){Price = 5, Description = "Push the players around!"}, + new Effect("Ice Physics", "ice_physics"){Price = 10, Description = "Summon frosty floors!", Duration=60}, + new Effect("Low Gravity", "low_grav"){Price = 5, Description = "Low gravity means players jump higher!", Duration=60}, + new Effect("Flood the Arena", "flood"){Price = 10, Description = "Flood the arena!", Duration=20}, + new Effect("Slow First Place Player", "first_place_slow"){Price = 5, Description = "The first place player is too good, let's punish them!", Duration=45}, + new Effect("Spawn an Attacking Bot (One Death)", "spawn_a_bot_attack"){Price = 10, Description = "This will spawn a bot on whatever team has the least amount of players and will be on the offensive"}, + new Effect("Spawn a Defending Bot (One Death)", "spawn_a_bot_defend"){Price = 10, Description = "This will spawn a bot on whatever team is has the least amount of players with orders to defend their base"}, + new Effect("Reset Domination Control Points", "reset_domination_control_points"){Price = 5, Description = "This will reset all control points in Domination Mode to neutral"}, + new Effect("Return Flags", "return_ctf_flags"){Price = 5, Description = "In Capture the Flag Mode, this will return all flags to their base"}, //////////////////////////////////////////////////////////////// - new Effect("Health and Armor","health",ItemKind.Folder), - new Effect("Full Heal", "full_heal","health"){Price = 5,Description = "Send a full heal to all players!"}, - new Effect("Shield Belts for All", "full_armour","health"){Price = 5,Description = "You get a shield belt and you get a shield belt! Everyone gets shield belts!"}, - new Effect("Give Health", "give_health",new[]{"amount200"},"health"){Price = 1,Description = "Give a little health!"}, - new Effect("Sudden Death", "sudden_death","health"){Price = 10,Description = "Activate sudden death mode!"}, - new Effect("Thanos Snap", "thanos","health"){Price = 15,Description = "Each player has a 50% chance of instantly being killed!"}, - new Effect("Vampiric Attacks", "vampire_mode","health"){Price = 10,Description = "All attacks by players sap some life, healing the player!",Duration=60}, - new Effect("Give Shield Belt to Last Place", "last_place_shield","health"){Price = 5,Description = "Help out that last place player!"}, - new Effect("Blue (Redeemer) Shell", "blue_redeemer_shell","health"){Price = 15,Description = "Drops a redeemer explosion on the player in first place!"}, + //new Effect("Health and Armor","health",ItemKind.Folder), + new Effect("Full Heal", "full_heal") { Category = "Health & Ammo", Price = 5, Description = "Send a full heal to all players!" }, + new Effect("Shield Belts for All", "full_armour") { Category = "Health & Ammo", Price = 5, Description = "You get a shield belt and you get a shield belt! Everyone gets shield belts!" }, + new Effect("Give Health", "give_health") + { + Quantity = 200, + Category = "Health & Ammo", + Price = 1, + Description = "Give a little health!" + }, + new Effect("Sudden Death", "sudden_death") { Category = "Health & Ammo", Price = 10, Description = "Activate sudden death mode!" }, + new Effect("Thanos Snap", "thanos") { Category = "Health & Ammo", Price = 15, Description = "Each player has a 50% chance of instantly being killed!" }, + new Effect("Vampiric Attacks", "vampire_mode") { Category = "Health & Ammo", Price = 10, Description = "All attacks by players sap some life, healing the player!", Duration=60 }, + new Effect("Give Shield Belt to Last Place", "last_place_shield") { Category = "Health & Ammo", Price = 5, Description = "Help out that last place player!" }, + new Effect("Blue (Redeemer) Shell", "blue_redeemer_shell") { Category = "Health & Ammo", Price = 15, Description = "Drops a redeemer explosion on the player in first place!" }, ///////////////////////////////////////////////////////////////// - new Effect("Weapons and Damage","weapons",ItemKind.Folder), - new Effect("Give Weapon to All", "give_weapon",new[]{"weaponlist"},"weapons"){Price = 5,Description = "Give all players any normal weapon in the game!"}, //Needs to use a weapons list - new Effect("Give Instagib Rifles to All", "give_instagib","weapons"){Price = 15,Description = "Give an Instagib Rifle to all players!"}, - new Effect("Give Redeemers to All", "give_redeemer","weapons"){Price = 15,Description = "Give a redeemer to all players!"}, - new Effect("Force Everybody to Use Weapon", "force_weapon_use",new[]{"weaponlist"},"weapons"){Price = 25,Description = "Force all players to only use one specific weapon you choose!",Duration=60}, //Needs to use a weapons list - new Effect("Force All Players to use Instagib Rifle", "force_instagib","weapons"){Price = 15,Description = "Force all players to use an Instagib Rifle only",Duration=60}, - new Effect("Force All Players to use Redeemers", "force_redeemer","weapons"){Price = 15,Description = "Force all players to use redeemers only!",Duration=60}, - new Effect("Give Ammo", "give_ammo",new[]{"ammolist","amount10"},"weapons"){Price = 1,Description = "Give some specific ammo of your choice to all players!"}, - new Effect("Remove All Ammo", "no_ammo","weapons"){Price = 10,Description = "Steal all ammo from players!"}, - new Effect("Bonus Damage for All", "bonus_dmg","weapons"){Price = 5,Description = "Pump up the damage on all players"}, - new Effect("Melee Only!", "melee_only","weapons"){Price = 10,Description = "Never mind these guns, it's punching time!",Duration=60}, - new Effect("Bonus Damage for Last Place", "last_place_bonus_dmg","weapons"){Price = 5,Description = "Help out the last place player and grant them bonus damage!"}, - new Effect("All Players Drop Current Weapon", "drop_selected_item","weapons"){Price = 10,Description = "Who needs this weapon anyway..."}, - - - - //////////////////////////////////////////////////////////////////////////////////////// - - - - - //Weapon list - new Effect("Translocator","translocator",ItemKind.Usable,"weaponlist"), - new Effect("Ripper","ripper",ItemKind.Usable,"weaponlist"), - new Effect("BioRifle","biorifle",ItemKind.Usable,"weaponlist"), - new Effect("Flak Cannon","flakcannon",ItemKind.Usable,"weaponlist"), - new Effect("Sniper Rifle","sniperrifle",ItemKind.Usable,"weaponlist"), - new Effect("Shock Rifle","shockrifle",ItemKind.Usable,"weaponlist"), - new Effect("Pulse Rifle","pulsegun",ItemKind.Usable,"weaponlist"), - new Effect("Minigun","minigun",ItemKind.Usable,"weaponlist"), - new Effect("Rocket Launcher","rocketlauncher",ItemKind.Usable,"weaponlist"), - - //Ammo List - new Effect("Flak Ammo","flakammo",ItemKind.Usable,"ammolist"), - new Effect("BioRifle Goo","bioammo",ItemKind.Usable,"ammolist"), - new Effect("Redeemer Missile","warheadammo",ItemKind.Usable,"ammolist"), - new Effect("Pulse Rifle Ammo","pammo",ItemKind.Usable,"ammolist"), - new Effect("Shock Rifle Core","shockcore",ItemKind.Usable,"ammolist"), - new Effect("Ripper Blades","bladehopper",ItemKind.Usable,"ammolist"), - new Effect("Rockets","rocketpack",ItemKind.Usable,"ammolist"), - new Effect("Sniper Ammo","bulletbox",ItemKind.Usable,"ammolist"), - new Effect("Minigun/Enforcer Ammo","miniammo",ItemKind.Usable,"ammolist"), - + //new Effect("Weapons and Damage","weapons",ItemKind.Folder), + new Effect("Give Weapon to All", "give_weapon") + { + Parameters = weaponList, + Category = "Weapons & Damage", + Price = 5, + Description = "Give all players any normal weapon in the game!" + }, //Needs to use a weapons list + new Effect("Give Instagib Rifles to All", "give_instagib") { Category = "Weapons & Damage", Price = 15, Description = "Give an Instagib Rifle to all players!" }, + new Effect("Give Redeemers to All", "give_redeemer") { Category = "Weapons & Damage", Price = 15, Description = "Give a redeemer to all players!" }, + new Effect("Force Everybody to Use Weapon", "force_weapon_use") + { + Parameters = weaponList, + Category = "Weapons & Damage", + Price = 25, + Description = "Force all players to only use one specific weapon you choose!", + Duration=60 + }, //Needs to use a weapons list + new Effect("Force All Players to use Instagib Rifle", "force_instagib") { Category = "Weapons & Damage", Price = 15, Description = "Force all players to use an Instagib Rifle only", Duration=60 }, + new Effect("Force All Players to use Redeemers", "force_redeemer") { Category = "Weapons & Damage", Price = 15, Description = "Force all players to use redeemers only!", Duration=60 }, + new Effect("Give Ammo", "give_ammo") + { + Quantity = 10, + Parameters = ammoList, + Category = "Weapons & Damage", + Price = 1, + Description = "Give some specific ammo of your choice to all players!" + }, + new Effect("Remove All Ammo", "no_ammo") { Category = "Weapons & Damage", Price = 10, Description = "Steal all ammo from players!" }, + new Effect("Bonus Damage for All", "bonus_dmg") { Category = "Weapons & Damage", Price = 5, Description = "Pump up the damage on all players" }, + new Effect("Melee Only!", "melee_only") { Category = "Weapons & Damage", Price = 10, Description = "Never mind these guns, it's punching time!", Duration=60 }, + new Effect("Bonus Damage for Last Place", "last_place_bonus_dmg") { Category = "Weapons & Damage", Price = 5, Description = "Help out the last place player and grant them bonus damage!" }, + new Effect("All Players Drop Current Weapon", "drop_selected_item") { Category = "Weapons & Damage", Price = 10, Description = "Who needs this weapon anyway..." } }; - - //Slider ranges need to be defined - public override List ItemTypes => new List(new[] - { - new ItemType("Amount","amount10",ItemType.Subtype.Slider, "{\"min\":1,\"max\":10}"), - new ItemType("Amount","amount200",ItemType.Subtype.Slider, "{\"min\":1,\"max\":200}"), - new ItemType("Weapons","weaponlist",ItemType.Subtype.ItemList), - new ItemType("Ammo","ammolist",ItemType.Subtype.ItemList), - }); }