Skip to content

Commit

Permalink
Add a Doom Mode Crowd Control effect (Can only look left and right -
Browse files Browse the repository at this point in the history
pitch is fixed straight forward) #407
  • Loading branch information
theastropath committed Mar 11, 2024
1 parent e385ff7 commit d816e18
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
5 changes: 5 additions & 0 deletions DXRVanilla/DeusEx/Classes/Player.uc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var DXRLoadouts loadout;
var bool bOnLadder;
var transient string nextMap;
var laserEmitter aimLaser;
var bool bDoomMode;

var Rotator ShakeRotator;

Expand Down Expand Up @@ -44,6 +45,10 @@ event PlayerCalcView(out actor ViewActor, out vector CameraLocation, out rotator
return;
} else {
Super.PlayerCalcView(ViewActor,CameraLocation,CameraRotation);
if (bDoomMode){
CameraRotation.Pitch=0;
ViewRotation.Pitch=0;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions DXRando.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,6 @@ public DeusEx(UserRecord player, Func<CrowdControlBlock, bool> responseHandler,
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!",Duration=60} //New for fifth Crowd Control batch
new Effect ("Doom Mode", "doom_mode"){Category = "Camera Effects",Price = 5,Description = "Drag the player to hell, a place where there is no looking up or down!",Duration=60} //New for fifth Crowd Control batch
};
}
41 changes: 41 additions & 0 deletions DXRando/DeusEx/Classes/DXRandoCrowdControlEffects.uc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const CameraRollTimeDefault = 60;
const EatBeansTimeDefault = 60;
const ResidentEvilTimeDefault = 60;
const RadiationTimeDefault = 60;
const DoomModeTimeDefault = 60;

struct ZoneFriction
{
Expand Down Expand Up @@ -249,6 +250,17 @@ function PeriodicUpdates()
if (decrementTimer('cc_Radioactive')){
PlayerMessage("You stop being radioactive");
}

#ifdef vanilla
if (isTimerActive('cc_DoomMode')){
Player().bDoomMode=True;
} else {
Player().bDoomMode=False;
}
#endif
if (decrementTimer('cc_DoomMode')){
PlayerMessage("You return to the normal world");
}
}

function HandleEffectSelectability()
Expand Down Expand Up @@ -626,6 +638,8 @@ function int getDefaultTimerTimeByName(name timerName) {
return ResidentEvilTimeDefault;
case 'cc_Radioactive':
return RadiationTimeDefault;
case 'cc_DoomMode':
return DoomModeTimeDefault;

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


default:
Expand Down Expand Up @@ -2556,6 +2572,9 @@ function int doCrowdControlEvent(string code, string param[5], string viewer, in
if (isTimerActive('cc_behindTimer')) {
return TempFail;
}
if (isTimerActive('cc_DoomMode')) {
return TempFail;
}
if (isTimerActive('cc_ResidentEvil')) {
return TempFail;
}
Expand Down Expand Up @@ -2587,6 +2606,28 @@ function int doCrowdControlEvent(string code, string param[5], string viewer, in
return TempFail;
}
break;
case "doom_mode":
if (!#defined(vanilla)){
//Changes in player class
PlayerMessage("Doom Mode effect unavailable in this mod");
return NotAvail;
}
if (!InGame()) {
return TempFail;
}
if (isTimerActive('cc_DoomMode')) {
return TempFail;
}
if (isTimerActive('cc_ResidentEvil')) {
return TempFail;
}
if (isTimerActive('cc_behindTimer')) {
return TempFail;
}
PlayerMessage(viewer@"dragged you to hell!");

startNewTimer('cc_DoomMode',duration);
break;

default:
return doCrowdControlEventWithPrefix(code, param, viewer, type, duration);
Expand Down
7 changes: 5 additions & 2 deletions DXRando/DeusEx/Classes/DXRandoCrowdControlLink.uc
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,11 @@ function int RandomOfflineEffects() {
case 86: return ccEffects.doCrowdControlEvent("giveenemyweapon_weaponlaw", param, viewer, 0, 0);
case 87: return ccEffects.doCrowdControlEvent("giveenemyweapon_weaponhideagun", param, viewer, 0, 0);
case 88: return ccEffects.doCrowdControlEvent("heal_all_enemies", param, viewer, 0, 0);
case 89: return ccEffects.doCrowdControlEvent("resident_evil", param, viewer, 0, 0);
case 90: return ccEffects.doCrowdControlEvent("corpse_explosion", param, viewer, 0, 0);
case 89: return ccEffects.doCrowdControlEvent("corpse_explosion", param, viewer, 0, 0);
#ifdef vanilla
case 90: return ccEffects.doCrowdControlEvent("resident_evil", param, viewer, 0, 0);
case 91: return ccEffects.doCrowdControlEvent("doom_mode", param, viewer, 0, 0);
#endif
}

return 0;
Expand Down

0 comments on commit d816e18

Please sign in to comment.