Skip to content

Commit

Permalink
Add radioactive Crowd Control effect #407
Browse files Browse the repository at this point in the history
  • Loading branch information
theastropath committed Mar 10, 2024
1 parent 491b230 commit eac450e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DXRando.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public DeusEx(UserRecord player, Func<CrowdControlBlock, bool> responseHandler,
new Effect ("Drop a piano on the player", "drop_piano"){Price = 10,Description = "Spawn a piano above the player to drop it on them, just like in the cartoons!"}, //New for fifth Crowd Control batch, v2.6
new Effect ("Toggle the Flashlight", "toggle_flashlight"){Price = 1,Description = "Toggle the flashlight!"}, //New for fifth Crowd Control batch, v2.6
new Effect ("Heal all Enemies", "heal_all_enemies"){Price = 10,Description = "Fully heal all enemies in the current level!"}, //New for fifth Crowd Control batch, v2.6
new Effect ("Make Player Radioactive", "radioactive"){Price = 10,Description = "The player becomes radioactive and starts hurting nearby people!",Duration=60}, //New for fifth Crowd Control batch, v2.6

//Spawn Enemies/Allies
//new Effect("Spawn Enemies/Allies","spawnpawns",ItemKind.Folder), //New for fourth Crowd Control batch
Expand Down Expand Up @@ -201,6 +202,6 @@ public DeusEx(UserRecord player, Func<CrowdControlBlock, bool> responseHandler,
new Effect("Go Third-Person","third_person"){Category = "Camera Effects",Price = 5,Description = "Change the game into a third person shooter for a minute!",Duration=60},
new Effect("Enable Matrix Mode", "matrix"){Category = "Camera Effects",Price = 5,Description = "Make the player see the code behind the game...",Duration=60},
new Effect ("Set off a Flashbang", "flashbang"){Category = "Camera Effects",Price = 5,Description = "Set off a flashbang in the players face"}, //New for fourth Crowd Control batch
new Effect ("Resident Evil Mode", "resident_evil"){Category = "Camera Effects",Price = 20,Description = "Switch the game to fixed camera angles! Very spooky!"} //New for fifth Crowd Control batch
new Effect ("Resident Evil Mode", "resident_evil"){Category = "Camera Effects",Price = 20,Description = "Switch the game to fixed camera angles! Very spooky!",Duration=60} //New for fifth Crowd Control batch
};
}
36 changes: 36 additions & 0 deletions DXRando/DeusEx/Classes/DXRandoCrowdControlEffects.uc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const EarthquakeTimeDefault = 30;
const CameraRollTimeDefault = 60;
const EatBeansTimeDefault = 60;
const ResidentEvilTimeDefault = 60;
const RadiationTimeDefault = 60;

struct ZoneFriction
{
Expand Down Expand Up @@ -241,6 +242,13 @@ function PeriodicUpdates()
quickLoadTriggered = False;
player().QuickLoadConfirmed();
}

if (isTimerActive('cc_Radioactive')){
PlayerRadiates();
}
if (decrementTimer('cc_Radioactive')){
PlayerMessage("You stop being radioactive");
}
}

function HandleEffectSelectability()
Expand Down Expand Up @@ -595,6 +603,8 @@ function int getDefaultTimerTimeByName(name timerName) {
return EatBeansTimeDefault;
case 'cc_ResidentEvil':
return ResidentEvilTimeDefault;
case 'cc_Radioactive':
return RadiationTimeDefault;

default:
PlayerMessage("Unknown timer name "$timerName);
Expand Down Expand Up @@ -650,6 +660,8 @@ function string getTimerLabelByName(name timerName) {
return "Beans";
case 'cc_ResidentEvil':
return "Fixed Cam";
case 'cc_Radioactive':
return "Radiation";


default:
Expand Down Expand Up @@ -1741,6 +1753,17 @@ function SpawnRECam()
reCam.BindPlayer(player());
}

function PlayerRadiates()
{
local ScriptedPawn sp;

//Radiate the same as a default gray - 10 damage per second in a 256 radius
foreach player().VisibleActors(class'ScriptedPawn', sp, 256)
sp.TakeDamage(10, player(), sp.Location, vect(0,0,0), 'Radiation');

}


function SplitString(string src, string divider, out string parts[8])
{
local int i, c;
Expand Down Expand Up @@ -2394,6 +2417,19 @@ function int doCrowdControlEvent(string code, string param[5], string viewer, in
player().bCrosshairVisible = False;
SpawnRECam();
return Success;

case "radioactive":
if (!InGame()) {
return TempFail;
}
if (isTimerActive('cc_Radioactive')) {
return TempFail;
}

PlayerMessage(viewer@"made you radioactive!");

startNewTimer('cc_Radioactive',duration);
break;
default:
return doCrowdControlEventWithPrefix(code, param, viewer, type, duration);
}
Expand Down

0 comments on commit eac450e

Please sign in to comment.