Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ZSCRIPT.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ class HDFollower : HDHumanoid abstract
Handler = FollowerHandler(EventHandler.Find('FollowerHandler'));

Super.BeginPlay();

baseScale = scale;
baseSize = (radius, height);
}

override void PostBeginPlay()
Expand Down Expand Up @@ -290,6 +293,9 @@ class HDFollower : HDHumanoid abstract
int MissPlayer;
property MissPlayer : MissPlayer;
int DodgeTimer;

Vector2 baseScale;
Vector2 baseSize;

Default
{
Expand Down
5 changes: 3 additions & 2 deletions zscript/AI.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ extend class HDFollower
CrouchFactor = max(CrouchFactor - 0.10, 0);
}

scale.y = default.scale.y * (1.0 - CrouchFactor);
A_SetSize(-1, default.Height * (1.0 - CrouchFactor));
A_SetScale(baseScale.x, baseScale.y * (1.0 - CrouchFactor));
A_SetSize(-1, baseSize.y * (1.0 - CrouchFactor));

cameraheight=GetDefaultByType("HDMobBase").CameraHeight * (1.0 - CrouchFactor);
gunheight=cameraheight-1.5;

Expand Down
22 changes: 1 addition & 21 deletions zscript/CommandMenu.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ extend class FollowerHandler
sb.Fill(Color(DarkAlpha, 0, 0, 0), pos.x + 1, pos.y + (size.y - 3), size.x - 2, 2, flags);
int mag = MaxMag == 1 ? int(wpn.ChamberedRound == wpn.CRType_Chambered) : wpn.Mag;
double amPercent = clamp(mag / double(MaxMag), 0, 1.0);
sb.Fill(GetPercentColor(amPercent), pos.x + 1, pos.y + (size.y - 3), (size.x - 2) * AmPercent, 2, flags);
if ((size.x - 2) * AmPercent > 0) sb.Fill(HDCore.GetPercentColor(amPercent, 192, true), pos.x + 1, pos.y + (size.y - 3), (size.x - 2) * AmPercent, 2, flags);
}
}

Expand Down Expand Up @@ -2172,26 +2172,6 @@ extend class FollowerHandler
}
}

private ui Color GetPercentColor(double percent)
{
if (percent >= 0.75)
{
return Color(192, 0, 224, 0);
}
else if (percent >= 0.50)
{
return Color(192, 255, 255, 0);
}
else if (percent >= 0.25)
{
return Color(192, 255, 128, 0);
}
else
{
return Color(192, 255, 0, 0);
}
}

private ui string GetTruncatedText(string text, int length)
{
if (text.Length() > length)
Expand Down
2 changes: 2 additions & 0 deletions zscript/Recruitment.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ extend class FollowerHandler
recruit.SetTag(GetUniqueMarineName(gender));
recruit.Translation = m.Translation;
recruit.voicepitch = m.voicepitch;
recruit.baseSize = (m.radius, m.height);
recruit.baseScale = m.scale;

FollowerWeapon fw;

Expand Down
40 changes: 20 additions & 20 deletions zscript/Weapons/Liberator.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -120,45 +120,45 @@ class FW_Liberator : FollowerWeapon
{
Mag = wpn.WeaponStatus[LIBS_MAG];
ChamberedRound = wpn.WeaponStatus[LIBS_CHAMBER];
if (wpn.WeaponStatus[LIBS_FLAGS] & LIBF_GRENADELOADED)
if (wpn.WeaponStatus[0] & LIBF_GRENADELOADED)
{
Owner.A_DropItem('HDRocketAmmo', 1);
Owner.A_StartSound("weapons/grenopen",CHAN_WEAPON);
}

nogl = wpn.WeaponStatus[LIBS_FLAGS] & LIBF_NOLAUNCHER? 1 : 0;
nobull = wpn.WeaponStatus[LIBS_FLAGS] & LIBF_NOBULLPUP? 1 : 0;
noauto = wpn.WeaponStatus[LIBS_FLAGS] & LIBF_NOAUTO? 1 : 0;
lefty = wpn.WeaponStatus[LIBS_FLAGS] & LIBF_LEFTY? 1 : 0;
altreticle = wpn.WeaponStatus[LIBS_FLAGS] & LIBF_ALTRETICLE? 1 : 0;
frontreticle = wpn.WeaponStatus[LIBS_FLAGS] & LIBF_FRONTRETICLE? 1 : 0;
nogl = wpn.WeaponStatus[0] & LIBF_NOLAUNCHER? 1 : 0;
nobull = wpn.WeaponStatus[0] & LIBF_NOBULLPUP? 1 : 0;
noauto = wpn.WeaponStatus[0] & LIBF_NOAUTO? 1 : 0;
lefty = wpn.WeaponStatus[0] & LIBF_LEFTY? 1 : 0;
altreticle = wpn.WeaponStatus[0] & LIBF_ALTRETICLE? 1 : 0;
frontreticle = wpn.WeaponStatus[0] & LIBF_FRONTRETICLE? 1 : 0;
Crossdot = wpn.weaponstatus[LIBS_DOT];
}

override void OnBackTransfer(HDWeapon wpn)
{
wpn.WeaponStatus[LIBS_MAG] = Mag;
wpn.WeaponStatus[LIBS_CHAMBER] = ChamberedRound;
wpn.weaponstatus[LIBS_FLAGS]&=~LIBF_GRENADELOADED;
wpn.weaponstatus[0]&=~LIBF_GRENADELOADED;


if(nogl>0)wpn.WeaponStatus[LIBS_FLAGS]|=LIBF_NOLAUNCHER;
else wpn.WeaponStatus[LIBS_FLAGS]&=~LIBF_NOLAUNCHER;
if(nogl>0)wpn.WeaponStatus[0]|=LIBF_NOLAUNCHER;
else wpn.WeaponStatus[0]&=~LIBF_NOLAUNCHER;

if(nobull>0)wpn.WeaponStatus[LIBS_FLAGS]|=LIBF_NOBULLPUP;
else wpn.WeaponStatus[LIBS_FLAGS]&=~LIBF_NOBULLPUP;
if(nobull>0)wpn.WeaponStatus[0]|=LIBF_NOBULLPUP;
else wpn.WeaponStatus[0]&=~LIBF_NOBULLPUP;

if(noauto>0)wpn.WeaponStatus[LIBS_FLAGS]|=LIBF_NOAUTO;
else wpn.WeaponStatus[LIBS_FLAGS]&=~LIBF_NOAUTO;
if(noauto>0)wpn.WeaponStatus[0]|=LIBF_NOAUTO;
else wpn.WeaponStatus[0]&=~LIBF_NOAUTO;

if(lefty>0)wpn.WeaponStatus[LIBS_FLAGS]|=LIBF_LEFTY;
else wpn.WeaponStatus[LIBS_FLAGS]&=~LIBF_LEFTY;
if(lefty>0)wpn.WeaponStatus[0]|=LIBF_LEFTY;
else wpn.WeaponStatus[0]&=~LIBF_LEFTY;

if(altreticle>0)wpn.WeaponStatus[LIBS_FLAGS]|=LIBF_ALTRETICLE;
else wpn.WeaponStatus[LIBS_FLAGS]&=~LIBF_ALTRETICLE;
if(altreticle>0)wpn.WeaponStatus[0]|=LIBF_ALTRETICLE;
else wpn.WeaponStatus[0]&=~LIBF_ALTRETICLE;

if(frontreticle>0)wpn.WeaponStatus[LIBS_FLAGS]|=LIBF_FRONTRETICLE;
else wpn.WeaponStatus[LIBS_FLAGS]&=~LIBF_FRONTRETICLE;
if(frontreticle>0)wpn.WeaponStatus[0]|=LIBF_FRONTRETICLE;
else wpn.WeaponStatus[0]&=~LIBF_FRONTRETICLE;


wpn.weaponstatus[LIBS_DOT] = Crossdot;
Expand Down
20 changes: 10 additions & 10 deletions zscript/Weapons/ZM66.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -120,32 +120,32 @@ class FW_ZM66 : FollowerWeapon
override void OnTransfer(HDWeapon wpn)
{
Mag = wpn.WeaponStatus[ZM66S_MAG];
ChamberedRound = wpn.WeaponStatus[ZM66S_FLAGS] & ZM66F_CHAMBER ? 2 : 0;
ChamberedRound = wpn.WeaponStatus[0] & ZM66F_CHAMBER ? 2 : 0;
if (wpn.WeaponStatus[0] & ZM66F_GRENADELOADED)
{
Owner.A_DropItem('HDRocketAmmo', 1);
Owner.A_StartSound("weapons/grenopen",CHAN_WEAPON);
}

nogl = wpn.WeaponStatus[ZM66S_FLAGS] & ZM66F_NOLAUNCHER? 1 : 0;
noauto = wpn.WeaponStatus[ZM66S_FLAGS] & ZM66F_NOFIRESELECT? 1 : 0;
nogl = wpn.WeaponStatus[0] & ZM66F_NOLAUNCHER? 1 : 0;
noauto = wpn.WeaponStatus[0] & ZM66F_NOFIRESELECT? 1 : 0;
Crossdot = wpn.weaponstatus[ZM66S_DOT];
}

override void OnBackTransfer(HDWeapon wpn)
{
wpn.WeaponStatus[ZM66S_MAG] = Mag;

wpn.weaponstatus[ZM66S_FLAGS]&=~ZM66F_GRENADELOADED;
wpn.weaponstatus[0]&=~ZM66F_GRENADELOADED;

if(ChamberedRound > 0)wpn.weaponstatus[ZM66S_FLAGS]|=ZM66F_CHAMBER;
else wpn.weaponstatus[ZM66S_FLAGS]&=~ZM66F_CHAMBER;
if(ChamberedRound > 0)wpn.weaponstatus[0]|=ZM66F_CHAMBER;
else wpn.weaponstatus[0]&=~ZM66F_CHAMBER;

if(nogl>0)wpn.WeaponStatus[ZM66S_FLAGS]|=ZM66F_NOLAUNCHER;
else wpn.WeaponStatus[ZM66S_FLAGS]&=~ZM66F_NOLAUNCHER;
if(nogl>0)wpn.WeaponStatus[0]|=ZM66F_NOLAUNCHER;
else wpn.WeaponStatus[0]&=~ZM66F_NOLAUNCHER;

if(noauto>0)wpn.WeaponStatus[ZM66S_FLAGS]|=ZM66F_NOFIRESELECT;
else wpn.WeaponStatus[ZM66S_FLAGS]&=~ZM66F_NOFIRESELECT;
if(noauto>0)wpn.WeaponStatus[0]|=ZM66F_NOFIRESELECT;
else wpn.WeaponStatus[0]&=~ZM66F_NOFIRESELECT;

wpn.weaponstatus[ZM66S_DOT] = Crossdot;
}
Expand Down
7 changes: 3 additions & 4 deletions zscript/Wearables.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,10 @@ extend class HDFollower
{
HDCore.log("Follower."..getClassName(), LOGGING_DEBUG, "Giving Shield Badge.");

name shieldName = 'VirWeakShields';



HDF.Give(self, "VirWeakShields");
let sss = HDPickup(FindInventory("VirWeakShields"));
HDF.Give(self, shieldName);
let sss = HDPickup(FindInventory(shieldName));
if (sss)
{
sss.amount = 1;
Expand Down