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
4 changes: 4 additions & 0 deletions LANGUAGE.Balthazar
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ BALTHAZAR_ARMORGIVE_UPGRADE_1 = "WE LOVE UPGRADES!";
BALTHAZAR_ARMORGIVE_UPGRADE_2 = "BETTER IS GOOD!";
BALTHAZAR_ARMORGIVE_UPGRADE_3 = "STRONG!";

BALTHAZAR_ARMORGIVE_WORNOVER_1 = "ANOTHER ONE!";
BALTHAZAR_ARMORGIVE_WORNOVER_2 = "MORE BETTER!";
BALTHAZAR_ARMORGIVE_WORNOVER_3 = "EVEN MORE!";

BALTHAZAR_ARMORGIVE_BETTERDURABILITY_1 = "MUCH BETTER!";
BALTHAZAR_ARMORGIVE_BETTERDURABILITY_2 = "WE LIKE THAT!";
BALTHAZAR_ARMORGIVE_BETTERDURABILITY_3 = "AH YES!";
Expand Down
4 changes: 4 additions & 0 deletions LANGUAGE.Daina
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ DAINA_ARMORGIVE_UPGRADE_1 = "I needed that upgrade. Thank you.";
DAINA_ARMORGIVE_UPGRADE_2 = "Wonderful!";
DAINA_ARMORGIVE_UPGRADE_3 = "Awesome.";

DAINA_ARMORGIVE_WORNOVER_1 = "Thanks, this will go great with the rest of my outfit.";
DAINA_ARMORGIVE_WORNOVER_2 = "Ooh, another one!";
DAINA_ARMORGIVE_WORNOVER_3 = "This gives me more chances for flair! Thanks.";

DAINA_ARMORGIVE_BETTERDURABILITY_1 = "Thanks, this will last much longer than my old armor.";
DAINA_ARMORGIVE_BETTERDURABILITY_2 = "Much better!";
DAINA_ARMORGIVE_BETTERDURABILITY_3 = "This gives me a much better sense of security. Thanks.";
Expand Down
4 changes: 4 additions & 0 deletions LANGUAGE.Freylis
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ FREYLIS_ARMORGIVE_UPGRADE_1 = "Thank you, this one is much better.";
FREYLIS_ARMORGIVE_UPGRADE_2 = "I really appreciate your concern for my well-being.";
FREYLIS_ARMORGIVE_UPGRADE_3 = "Great stuff. Thanks.";

FREYLIS_ARMORGIVE_WORNOVER_1 = "I hope it comes with more pocket space.";
FREYLIS_ARMORGIVE_WORNOVER_2 = "I'm just glad it fits.";
FREYLIS_ARMORGIVE_WORNOVER_3 = "Another one couldn't hurt.";

FREYLIS_ARMORGIVE_BETTERDURABILITY_1 = "Better than the old one, that's for sure.";
FREYLIS_ARMORGIVE_BETTERDURABILITY_2 = "Has fewer dents than the old one.";
FREYLIS_ARMORGIVE_BETTERDURABILITY_3 = "Definitely sturdier than what I have.";
Expand Down
4 changes: 4 additions & 0 deletions LANGUAGE.Nari
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ NARI_ARMORGIVE_UPGRADE_1 = "I needed that upgrade. Thank you.";
NARI_ARMORGIVE_UPGRADE_2 = "Wonderful!";
NARI_ARMORGIVE_UPGRADE_3 = "Awesome.";

NARI_ARMORGIVE_WORNOVER_1 = "Thanks, this will go great with the rest of my outfit.";
NARI_ARMORGIVE_WORNOVER_2 = "Ooh, another one!";
NARI_ARMORGIVE_WORNOVER_3 = "This gives me more chances for flair! Thanks.";

NARI_ARMORGIVE_BETTERDURABILITY_1 = "Thanks, this will last much longer than my old armor.";
NARI_ARMORGIVE_BETTERDURABILITY_2 = "Much better!";
NARI_ARMORGIVE_BETTERDURABILITY_3 = "This gives me a much better sense of security. Thanks.";
Expand Down
4 changes: 4 additions & 0 deletions LANGUAGE.RecruitedMarine
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ MARINE_ARMORGIVE_UPGRADE_1 = "Thank you, commander.";
MARINE_ARMORGIVE_UPGRADE_2 = "Awesome.";
MARINE_ARMORGIVE_UPGRADE_3 = "Good stuff, commander.";

MARINE_ARMORGIVE_WORNOVER_1 = "I'll put it to good use, commander.";
MARINE_ARMORGIVE_WORNOVER_2 = "Does it come with more pockets, commander?";
MARINE_ARMORGIVE_WORNOVER_3 = "Another layer of protection.";

MARINE_ARMORGIVE_BETTERDURABILITY_1 = "Much obliged, commander.";
MARINE_ARMORGIVE_BETTERDURABILITY_2 = "Bless you, commander.";
MARINE_ARMORGIVE_BETTERDURABILITY_3 = "This will last much longer.";
Expand Down
4 changes: 4 additions & 0 deletions LANGUAGE.Sewie
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ SEWIE_ARMORGIVE_UPGRADE_1 = "I needed that upgrade. Thank you.";
SEWIE_ARMORGIVE_UPGRADE_2 = "Wonderful!";
SEWIE_ARMORGIVE_UPGRADE_3 = "Awesome.";

SEWIE_ARMORGIVE_WORNOVER_1 = "Thanks, this will go great with the rest of my outfit.";
SEWIE_ARMORGIVE_WORNOVER_2 = "Ooh, another one!";
SEWIE_ARMORGIVE_WORNOVER_3 = "This gives me more chances for flair! Thanks.";

SEWIE_ARMORGIVE_BETTERDURABILITY_1 = "Thanks, this will last much longer than my old armor.";
SEWIE_ARMORGIVE_BETTERDURABILITY_2 = "Much better!";
SEWIE_ARMORGIVE_BETTERDURABILITY_3 = "This gives me a much better sense of security. Thanks.";
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Hideous Destructor Followers
_Originally made by Accensus, now maintained by the community._
_Requires [HDCoreLib](https://github.com/HDest-Community/hdest-core-lib)._

**NOTE: *Freylis's sprites are not for public use. Please do not use them anywhere. Thank you.***

Expand Down Expand Up @@ -131,4 +132,4 @@ Sounds:
> ### Known Issues
> ---
> - Sometimes followers will fail to follow the player or other followers while in specific sectors even if nothing obvious is blocking their way. This primarily happens on older maps that use the REJECT lump for sight checking. I don't know of a possible fix without side effects that I could implement on the mod's side.
>
>
5 changes: 2 additions & 3 deletions zscript/AI.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ extend class HDFollower
SetStateLabel('StapleOwnAss');
}

if (Status <= FStatus_WaitingForWeapon)
//if (Status >= FStatus_WaitingForWearable && Status <= FStatus_WaitingForWeapon)
if (Status >= FStatus_WaitingForWearable && Status <= FStatus_WaitingForWeapon)
{
switch (Status)
{
//case FStatus_WaitingForWearable: LookForWearable(); break;
case FStatus_WaitingForWearable: LookForWearable(); break;
case FStatus_WaitingForWeapon: LookForWeapon(); break;
}
A_Face(LinkedPlayer, 15);
Expand Down
45 changes: 33 additions & 12 deletions zscript/CommandMenu.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -915,23 +915,45 @@ extend class FollowerHandler
sb.Fill(col, pos.x, pos.y, size.x, size.y, flags);
sb.Fill(Color(DarkAlpha, 0, 0, 0), pos.x + 1, pos.y + 1, size.x - 2, size.y - 2, flags);

if (wearable is 'HDWeapon')
if (wearable is 'HDStorageItem')
{
if (!(Level.time % TICRATE)) HDCore.log("Follower."..getClassName(), LOGGING_DEBUG, "Drawing HDStorageItem Wearable: '"..wearable.getClassName().."'...");

sb.DrawImage(""..wearable.Icon, pos + size / 2, flags | sb.DI_ITEM_CENTER, box: size - (3, 3));
sb.DrawString(fnt, sb.FormatNumber(HDWeapon(wearable).GetSBarNum(), 1, 4), pos + size - (4, 10), flags | sb.DI_TEXT_ALIGN_RIGHT, sb.SavedColour);
sb.DrawString(fnt, "\c[Olive]"..sb.FormatNumber(HDStorageItem(wearable).GetSBarNum(), 1, 4), pos + size - (4, 10), flags | sb.DI_TEXT_ALIGN_RIGHT);
}

if (wearable is 'HDArmourWorn')
else if (wearable is 'HDWeapon')
{
sb.DrawImage(HDArmourWorn(wearable).mega?"ARMCA0":"ARMSA0", pos + size / 2, flags | sb.DI_ITEM_CENTER, box: size - (3, 3));
sb.DrawString(fnt, (HDArmourWorn(wearable).Mega ? "\c[Blue]" : "\c[DarkGreen]")..HDArmourWorn(wearable).Durability, pos + size - (4, 10), flags | sb.DI_TEXT_ALIGN_RIGHT);
if (!(Level.time % TICRATE)) HDCore.log("Follower."..getClassName(), LOGGING_DEBUG, "Drawing HDWeapon Wearable: '"..wearable.getClassName().."'...");

sb.DrawImage(""..wearable.Icon, pos + size / 2, flags | sb.DI_ITEM_CENTER, box: size - (3, 3));
sb.DrawString(fnt, sb.FormatNumber(HDWeapon(wearable).GetSBarNum(), 1, 4), pos + size - (4, 10), flags | sb.DI_TEXT_ALIGN_RIGHT, sb.SavedColour);
}
else if (wearable is 'HDArmourWorn')
{
if (!(Level.time % TICRATE)) HDCore.log("Follower."..getClassName(), LOGGING_DEBUG, "Drawing HDArmourWorn Wearable: '"..wearable.getClassName().."'...");

if (wearable is 'HDMagicShield')
if (HDArmourWorn(wearable).bDROPTRANSLATION) {
sb.DrawImage(""..HDArmourWorn(wearable).armoursprite, pos + size / 2, flags | sb.DI_ITEM_CENTER | sb.DI_TRANSLATABLE, box: size - (3, 3), translation: wearable.owner.translation);
} else {
sb.DrawImage(""..HDArmourWorn(wearable).armoursprite, pos + size / 2, flags | sb.DI_ITEM_CENTER, box: size - (3, 3));
}
sb.DrawString(fnt, "\c[White]"..HDArmourWorn(wearable).durability, pos + size - (4, 10), flags | sb.DI_TEXT_ALIGN_RIGHT);
}
else if (wearable is 'HDMagicShield')
{
if (!(Level.time % TICRATE)) HDCore.log("Follower."..getClassName(), LOGGING_DEBUG, "Drawing HDMagicShield Wearable: '"..wearable.getClassName().."'...");

sb.DrawImage(""..wearable.Icon, pos + size / 2, flags | sb.DI_ITEM_CENTER, box: size - (3, 3));
sb.DrawString(fnt, "\c[Cyan]"..HDMagicShield(wearable).amount, pos + size - (4, 10), flags | sb.DI_TEXT_ALIGN_RIGHT);
}
else
{
if (!(Level.time % TICRATE)) HDCore.log("Follower."..getClassName(), LOGGING_WARN, "Attempting to Draw Unknown Wearable: '"..wearable.getClassName().."'...");

sb.DrawImage(""..wearable.Icon, pos + size / 2, flags | sb.DI_ITEM_CENTER, box: size - (3, 3));
sb.DrawString(fnt, "\c[DarkGray]"..wearable.amount, pos + size - (4, 10), flags | sb.DI_TEXT_ALIGN_RIGHT);
}
}

private ui void DrawRectangle(HDStatusBar sb, vector2 pos, vector2 size, Color col, HUDFont fnt, string command, int flags, int textCol = Font.CR_WHITE)
Expand Down Expand Up @@ -1798,11 +1820,10 @@ extend class FollowerHandler

if (cmd.IndexOf("hdf_wearablecommand") != -1)
{

static const Name worldItemClasses[] = { 'HDArmour', 'PortableRadsuit', 'HDBackpack', 'HDPersonalShieldGenerator', 'ShieldCore' };
static const Name wornItemClasses[] = { 'HDArmourWorn', 'WornRadsuit', 'HDBackpack', 'HDPersonalShieldGenerator', 'HDMagicShield' };
static const string languagePrefixex[] = { "ARMORGIVE", "RADSUITGIVE", "BACKPACKGIVE", "PSGGIVE", "SHIELDCOREGIVE" };
static const string soundPrefixes[] = { "ArmorGive", "RadsuitGive", "BackpackGive", "PSGGive", "ShieldCoreGive" };
static const Name worldItemClasses[] = { 'HDArmour', 'PortableRadsuit', 'HDStorageItem', 'HDPersonalShieldGenerator', 'ShieldCore' };
static const Name wornItemClasses[] = { 'HDArmourWorn', 'WornRadsuit', 'HDStorageItem', 'HDPersonalShieldGenerator', 'HDMagicShield' };
static const string languagePrefixex[] = { "ARMORGIVE", "RADSUITGIVE", "BACKPACKGIVE", "PSGGIVE", "SHIELDCOREGIVE" };
static const string soundPrefixes[] = { "ArmorGive", "RadsuitGive", "BackpackGive", "PSGGive", "ShieldCoreGive" };

lastFol.WearableInfo.WorldItemCls = worldItemClasses[e.Args[0]];
lastFol.WearableInfo.WornItemCls = wornItemClasses[e.Args[0]];
Expand Down
49 changes: 24 additions & 25 deletions zscript/Data.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ class FollowerData play

int SuturesLeft;

name ArmorCls;
int ArmorDurability;
bool ArmorMega;

bool HasRadsuit;

ItemStorage Storage;
name StorageCls;
Array<String> StorageContents;
int StorageBulk;

Array<HDWeaponData> WeaponData;
Array<HDShieldData> ShieldData;
Expand Down Expand Up @@ -141,19 +143,21 @@ extend class HDFollower

data.SuturesLeft = SuturesLeft;

let armor = HDArmourWorn(FindInventory("HDArmourWorn"));
let armor = HDArmourWorn(FindInventory('HDArmourWorn', true));
if (armor)
{
data.ArmorDurability = Armor.Durability;
data.ArmorMega = Armor.Mega;
data.ArmorCls = armor.GetClassName();
data.ArmorDurability = armor.Durability;
}

data.HasRadsuit = FindInventory('WornRadsuit') != null;

let bpack = HDBackpack(FindInventory('HDBackpack'));
let bpack = HDStorageItem(FindInventory('HDStorageItem', true));
if (bpack)
{
data.Storage = bpack.Storage;
data.StorageCls = bpack.GetClassName();
data.StorageContents.copy(bpack.items);
data.StorageBulk = bpack.weaponBulk();
}

for (Inventory next = Inv; next != null; next = Next.Inv)
Expand All @@ -167,7 +171,7 @@ extend class HDFollower
{
wepData.WeaponStatus[i] = wpn.WeaponStatus[i];
}
Console.Printf(wpn.GetClassName());
// Console.Printf(wpn.GetClassName());
data.WeaponData.Push(wepData);
}

Expand Down Expand Up @@ -225,7 +229,7 @@ class FollowerBody : HDPickup abstract
double total = 0;
for (int i = 0; i < Data.Size(); ++i)
{
total += default.Bulk + (Data[i].Storage != null ? 100 + Data[i].Storage.TotalBulk * 0.7 : 0);
total += default.Bulk + Data[i].StorageBulk;
}
return total;
}
Expand Down Expand Up @@ -254,25 +258,19 @@ class FollowerBody : HDPickup abstract
{
FollowerData data = invoker.Data[invoker.Data.Size() - 1];

bool forced = invoker.FromIncap || HDCore.isPreSpawn();
bool ReturnValue = false;
for (int i = 0; i < 100; ++i)
{
Actor a; bool success;

int Distance = random(20, 48);
int RandAngle = invoker.FromIncap || level.time < 2 ? random(0, 359) : 0;
int RandAngle = forced ? random(0, 359) : 0;
vector3 dest = Vec3Angle(Distance, angle + RandAngle);
Sector sec = level.PointInSector(dest.xy);
if (sec && pos.z - sec.NextLowestFloorAt(dest.x, dest.y, dest.z) > GetDefaultByType(data.FollowerClass).MaxStepHeight || !level.IsPointInLevel(dest))
Sector sec = Level.PointInSector(dest.xy);
if (sec && pos.z - sec.NextLowestFloorAt(dest.x, dest.y, dest.z) > GetDefaultByType(data.FollowerClass).MaxStepHeight || !Level.IsPointInLevel(dest))
{
if (invoker.FromIncap || level.time < 2)
{
continue;
}
else
{
break;
}
if (forced) continue; else break;
}

[success, a] = A_SpawnItemEx(data.FollowerClass, Distance, 0, random(8, 16), angle: RandAngle);
Expand Down Expand Up @@ -320,9 +318,9 @@ class FollowerBody : HDPickup abstract

if (data.ArmorDurability > 0)
{
let armor = HDArmourWorn(fol.GiveInventoryType('HDArmourWorn'));
let armor = HDArmourWorn(fol.GiveInventoryType(data.ArmorCls));
armor.Durability = data.ArmorDurability;
armor.Mega = data.ArmorMega;
// armor.Mega = data.ArmorMega;
}

if (data.HasRadsuit)
Expand All @@ -331,10 +329,11 @@ class FollowerBody : HDPickup abstract
fol.GiveInventoryType('PortableRadsuit');
}

if (data.Storage != null)
if (data.StorageCls != 'None')
{
let bpack = HDBackpack(fol.GiveInventoryType('HDBackpack'));
bpack.Storage = data.Storage;
let bpack = HDStorageItem(fol.GiveInventoryType(data.StorageCls));
bpack.items.copy(data.StorageContents);
bpack.RecalculateBulk();
}

for (int j = 0; j < data.WeaponData.Size(); ++j)
Expand Down
2 changes: 1 addition & 1 deletion zscript/FollowerHandler.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class FollowerHandler : EventHandler
while (Followers.Size() > 0)
{
HDFollower flw = Followers[0];
if (flw.IsDeadOrMissing())
if (!flw || flw.IsDeadOrMissing())
{
RemoveFollower(flw, true);
}
Expand Down
30 changes: 13 additions & 17 deletions zscript/Loadout.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,21 @@ extend class HDFollower

for (int i = 0; i < lines.Size(); ++i)
{
int amt = lines[i].Mid(3).ToInt();
if (amt == 0)
{
amt = 1;
}
string ref = lines[i].Left(3);
int amt = max(1, lines[i].Mid(3).ToInt());

class<Inventory> cls = HDBackpack.FindByRefId(ref);
if (!cls)
{
Continue;
}
class<Inventory> cls = HDHandlers.ParseRefID(lines[i].Left(3));
if (!cls) Continue;

if (cls is 'GarrisonArmour' || cls is 'GarrisonArmourWorn' || cls is 'BattleArmour' || cls is 'BattleArmourWorn')
if (cls is 'HDArmour')
{
bool mega = cls == 'BattleArmour' || cls == 'BattleArmourWorn';
GiveArmour(1.0, mega ? 1.0 : 0, amt);
HDF.Give(self, cls);
UseInventory(FindInventory(cls));
continue;
}
else if (cls is 'HDArmourWorn')
{
HDF.Give(self, cls);
}

if (cls is 'HDWeapon' && !GetDefaultByType((class<HDWeapon>)(cls)).bWIMPY_WEAPON)
{
Expand Down Expand Up @@ -68,10 +64,10 @@ extend class HDFollower
}
else
{
if (cls is 'HDBackpack')
if (cls is 'HDStorageItem')
{
let bp = HDBackpack(GiveInventoryType('HDBackpack'));
bp.LoadoutConfigure(input.Mid(input.IndexOf("bak") + 3));
let bp = HDStorageItem(GiveInventoryType(cls));
bp.LoadoutConfigure(input.Mid(input.IndexOf(lines[i].Left(3)) + 3));
}
else if (cls is 'PortableRadsuit')
{
Expand Down
21 changes: 12 additions & 9 deletions zscript/Management.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,21 @@ extend class FollowerHandler

void RemoveFollower(HDFollower flw, bool permanent = false, bool noDestroy = false)
{
int Index = Followers.Find(flw);
if (Index != Followers.Size())
if (flw)
{
if (permanent && flw.MissingClass && players[Net_Arbitrator].mo)
int Index = Followers.Find(flw);
if (Index != Followers.Size())
{
players[Net_Arbitrator].mo.A_GiveInventory(flw.MissingClass);
}
if (!noDestroy)
{
flw.Destroy();
if (permanent && flw.MissingClass && players[Net_Arbitrator].mo)
{
players[Net_Arbitrator].mo.A_GiveInventory(flw.MissingClass);
}
if (!noDestroy)
{
flw.Destroy();
}
Followers.Delete(Index);
}
Followers.Delete(Index);
}
}

Expand Down
Loading