Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add third automatic loot option for food and drinks, to have them be consumed immediately #832

Merged
merged 94 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
fb1728e
add (nonfuntional) autoconsume options
MQDuck Jun 26, 2024
9ef383d
combine pick up, drop and autoconsume options. use separate config va…
MQDuck Jun 26, 2024
c7eb17d
modify `TryLootItem` check slightly
MQDuck Jun 27, 2024
e6ee3f3
use string for loot action settings, and also keep autoconsume from c…
MQDuck Jun 29, 2024
4da0830
ConsumableWouldHelp function
MQDuck Jul 18, 2024
561f231
ConsumableWouldHelp checks HealingItem values
MQDuck Jul 18, 2024
bae6470
fix HX build
Die4Ever Jun 21, 2024
2308b2e
preproc var for bingocheat
Die4Ever Jun 21, 2024
cea911f
bump version to v3.0.1.0 Alpha for devs
Die4Ever Jun 21, 2024
7526540
buff regular sword
Die4Ever Jun 22, 2024
b6fb0be
WeaponMegaChoices now clear out any FlagRefs on the weapon choices so
theastropath Jun 22, 2024
faed71e
Fix randomized robot names
theastropath Jun 22, 2024
5ef0e94
Reorganize how pawns with different familiar and unfamiliar names are
theastropath Jun 23, 2024
b017560
Thrown Projectiles will no longer take damage from halon
theastropath Jun 23, 2024
8f41aef
Gunther and Gilbert have ammo for the possible weapons you can give them
theastropath Jun 23, 2024
7e271ae
If giving ammo, an add_ammo amount should apply even if the pawn doesn't
theastropath Jun 23, 2024
8f47dd4
Throwing grenades and turning to a wall now only gives you your ammo
theastropath Jun 23, 2024
acbaba2
Smoke and gas leaking from barrels will now be moved when they are
theastropath Jun 28, 2024
81ecf92
Enemies in the Hong Kong Helibase robot bays can no longer open the
theastropath Jun 28, 2024
198a9b1
add spaces to JacobsShadow hint (#808)
MQDuck Jun 28, 2024
07ac914
lower the alarm inside M03 boat house (#811)
MQDuck Jun 28, 2024
e57fb16
sewer teleporter in 09_NYC_DOCKYARD can't be squeezed past (#816)
MQDuck Jun 28, 2024
9130656
vans not breakable in Zero Rando
Die4Ever Jun 28, 2024
575e536
fix HX build
Die4Ever Jun 28, 2024
b52b1b0
splits overlay is an Advanced game option (#824)
MQDuck Jun 28, 2024
cebc4ae
give "Trash" and "Not Trash" separate keyboard shortcuts (#829)
MQDuck Jun 29, 2024
b5734b3
paul's bathroom door doesn't shut instantaneously (#817)
MQDuck Jun 29, 2024
6fa0804
stand on warehouse fence without tap dancing
Die4Ever Jun 29, 2024
6bcee51
revert old nerf of master pistol 180% vs vanilla 200%, because we hav…
Die4Ever Jun 29, 2024
fb429d4
EMP disables cloak
Die4Ever Jun 29, 2024
c5896c6
don't give "Rick" a random name when memes are disabled
Die4Ever Jun 29, 2024
67c5f17
Small autoturrets fire at half the rate of full sized turrets. Make
theastropath Jun 29, 2024
255ca31
Spawned autoturrets can now randomly be small or large
theastropath Jun 29, 2024
8458b06
Restore overheard conversation in superfreighter over "loudspeaker" in
theastropath Jun 29, 2024
c4b7b04
Restore last infolink from Helios in Area 51
theastropath Jun 29, 2024
a610a2a
Fix the "Critical Loctaion Bonus" typo in Area 51 Final... finally.
theastropath Jun 29, 2024
1d7162f
Is this a Jojo reference?
theastropath Jun 29, 2024
9463d32
dxvk.conf max of 500 fps
Die4Ever Jun 30, 2024
535a1c1
More piano practice for JC
theastropath Jul 1, 2024
8a654e2
Piano will now show how many songs have been played
theastropath Jul 2, 2024
ca31856
Piano will now make sure all songs get played an equal number of times,
theastropath Jul 3, 2024
44a9c88
Each piano song can have individual weighting
theastropath Jul 3, 2024
4b9cfbb
Add Terran 1 to Piano
theastropath Jul 3, 2024
9ef34aa
Blizzard, in it's infinite wisdom, decided it was a good idea to
theastropath Jul 3, 2024
3d91883
buff range mod, nerf ranges for pistols and assault rifle, buff accur…
Die4Ever Jul 4, 2024
ff62603
aug tree white color for selector
Die4Ever Jul 4, 2024
4cc93ec
slightly increase pistol ammo (#842)
Die4Ever Jul 4, 2024
8b2c614
Oops, more bangers on the piano
theastropath Jul 4, 2024
d83d22f
I slipped and dropped these great piano tracks
theastropath Jul 4, 2024
01c02c1
weapon descriptions tell you if it's a good roll or a bad roll (#844)
Die4Ever Jul 4, 2024
6d58c9a
weapon/aug/skill descriptions tell you if it's a good roll or a bad r…
Die4Ever Jul 4, 2024
13df6e2
Item swaps fail if they move to the other side of a wall. Make sure
theastropath Jul 6, 2024
83d7a05
installer DXVK Linux, off by default
Die4Ever Jul 7, 2024
6833ad6
aug tree, fix draw styles
Die4Ever Jul 11, 2024
5138519
Oceanlab UC and Area 51 bunker big fans are highlightable so you can see
theastropath Jul 13, 2024
85e64e5
Crowd Control "give item" effects now become selectable based on the
theastropath Jul 13, 2024
e900c1c
Move Ocean Lab greasel lab backtrack button closer to the wall
theastropath Jul 15, 2024
318ee5d
Fan in Vandenberg Computer is now highlightable
theastropath Jul 16, 2024
e2594b8
savage doesn't give you an aug on post gas station starts
MQDuck Jul 6, 2024
d30ccac
fix typo in smuggler intercom (#809)
MQDuck Jul 16, 2024
4878ac4
More extensive goal information in notes directory (#800)
MQDuck Jul 16, 2024
caef5bb
the exit teleporter from nsfhq can't be crawled under (#812)
MQDuck Jul 16, 2024
605799d
water cooler in versalife break room faces away from the wall (#813)
MQDuck Jul 16, 2024
ba4d76f
free and infinite aqualung (#845)
MQDuck Jul 16, 2024
0d5e1ea
fix clothes racks with LDDP when memes are disabled (#833)
MQDuck Jul 16, 2024
7b208a1
restore Everett barks (#840)
MQDuck Jul 16, 2024
bbf663b
SkillComputer slightly nerf trained speed in Zero Rando so that the "…
Die4Ever Jul 16, 2024
d24823f
teleporters block actors
Die4Ever Jul 16, 2024
d5eb596
DXVK 2.4
Die4Ever Jul 16, 2024
ba04f92
fix "cemetery" misspelling in 09_NYC_GRAVEYARD startupMessage (#818)
MQDuck Jul 16, 2024
c647b6f
CleanerBots don't move when disabled (#847)
MQDuck Jul 16, 2024
b29e605
Fix the "You can dance if you want to" goal not being marked if the S…
MQDuck Jul 17, 2024
08acb0a
restore commando barks in 06_HONGKONG_STORAGE (#814)
MQDuck Jul 17, 2024
9bfb8ea
change btnLabelResetToDefaults string so it doesn't conflict with But…
MQDuck Jul 17, 2024
b80f44e
DXRAnimTracker work in progress
Die4Ever Jul 18, 2024
94ab052
Singular bingo goal descriptions (#803)
MQDuck Jul 18, 2024
cf7eb26
Chateau DuClare with fixed max value (tour 5 parts, and collect 3 key…
Die4Ever Jul 18, 2024
3bd3838
open vandenberg comm building doors immediately on 129+ starts (#853)
MQDuck Jul 18, 2024
b66f1ae
Improvements and fixes for adding goals and DXRStartMap (#797)
MQDuck Jul 18, 2024
134f128
restore riot cop barks in 08_NYC_HOTEL (#815)
MQDuck Jul 18, 2024
2b00656
change "woman" unfamiliarName to "Woman" (#819)
MQDuck Jul 18, 2024
9057698
slightly move M01 boat Top of Statue so it's easier to see from UNATCO
Die4Ever Jul 18, 2024
8dac98f
M06 rename DTS boatperson location to canal waterside apartment
Die4Ever Jul 18, 2024
7e24c6b
m08 free clinic location closer to door
Die4Ever Jul 18, 2024
6f45d4e
slightly faster sword animations (#842)
Die4Ever Jul 18, 2024
9dacae4
Merge branch 'develop' into autoconsume
MQDuck Jul 18, 2024
d9c9646
move ConsumableWouldHelp to DXRPlayer
MQDuck Jul 18, 2024
41f00d5
Merge branch 'develop' into autoconsume
Die4Ever Jul 22, 2024
7b231e8
autoconsume some cleanup
Die4Ever Jul 22, 2024
55eb023
disable refuse button for items set to autoconsume
MQDuck Jul 23, 2024
909105a
Update DXRVanilla/DeusEx/Classes/Player.uc
MQDuck Jul 25, 2024
c09a8ec
Merge branch 'develop' into autoconsume
Die4Ever Jul 25, 2024
51bf5c6
Merge branch 'develop' into autoconsume
Die4Ever Jul 25, 2024
fdaa2b9
tweak defaults for melee weapons
Die4Ever Jul 25, 2024
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
13 changes: 11 additions & 2 deletions DXRFixes/DeusEx/Classes/Carcass.uc
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,13 @@ function Frob(Actor Frobber, Inventory frobWith)
function bool TryLootItem(DeusExPlayer player, Inventory item)
{
local DeusExPickup invItem;
local int itemCount, newAmmoAmmout, ammoAddedAmount;
local int itemCount, newAmmoAmmout, ammoAddedAmount, action;
local Weapon weap;
local Ammo playerAmmo;

if (class'DXRLoadouts'.static.IsRefused(item.class)) {
action = class'DXRLoadouts'.static.GetLootAction(item.class);

if (action == 1) { // drop
weap = Weapon(item);
if (weap != None && weap.AmmoName != class'AmmoNone') {
playerAmmo = Ammo(player.FindInventoryType(weap.AmmoName));
Expand All @@ -281,6 +283,13 @@ function bool TryLootItem(DeusExPlayer player, Inventory item)
return true;
}

if (action == 2 && Human(player).ConsumableWouldHelp(item) && DeusExPickup(item) != None) { // consume
DeleteInventory(item);
DeusExRootWindow(player.rootWindow).hud.receivedItems.AddItem(item, 1);
Human(player).InstantlyUseItem(DeusExPickup(item));
return true;
}

if (item.IsA('NanoKey'))
{
player.PickupNanoKey(NanoKey(item));
Expand Down
79 changes: 36 additions & 43 deletions DXRModules/DeusEx/Classes/DXRLoadouts.uc
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,11 @@ simulated function PlayerLogin(#var(PlayerPawn) p)

RandoStartingEquipment(p, false);
#ifdef injections
class'MenuChoice_RefuseUseless'.static.SetRefusals();
class'MenuChoice_RefuseFoodDrink'.static.SetRefusals();
class'MenuChoice_RefuseMelee'.static.SetRefusals();
class'MenuChoice_RefuseMisc'.static.SetRefusals();
class'MenuChoice_LootActionUseless'.static.SetActions();
class'MenuChoice_LootActionFoodSoda'.static.SetActions();
class'MenuChoice_LootActionAlcohol'.static.SetActions();
class'MenuChoice_LootActionMelee'.static.SetActions();
class'MenuChoice_LootActionMisc'.static.SetActions();
#endif
}

Expand Down Expand Up @@ -696,53 +697,45 @@ function SpawnItems()
reducer.Timer();
}

static function bool IsRefused(class<Inventory> type, optional out int strIdx)
{
local DataStorage datastorage;
local string refusals;

datastorage = class'DataStorage'.static.GetObj(class'DXRando'.default.dxr);
refusals = datastorage.GetConfigKey("item_refusals");
if(refusals == "") {
return false;
static function int GetLootAction(
class<Inventory> itemClass,
optional DataStorage storage,
optional out string lootActions,
optional out int strIdx
) {
if (storage == None)
storage = class'DataStorage'.static.GetObj(class'DXRando'.default.dxr);

lootActions = storage.GetConfigKey("loot_actions");
strIdx = InStr(lootActions, "," $ itemClass.name $ "=");
if (strIdx != -1) {
return Int(Mid(lootActions, strIdx + Len(itemClass.name) + 2, 1));
}
strIdx = InStr(refusals, "," $ type.name $ ",");
return strIdx != -1;
return 0;
}

static function UnsetRefuseItem(class<Inventory> type)
static function SetLootAction(class<Inventory> itemClass, int action, optional DataStorage storage)
{
local DataStorage datastorage;
local string refusals, leftPart, rightPart;
local string lootActions, leftPart, rightPart;
local int strIdx;

if (!IsRefused(type, strIdx))
return;

datastorage = class'DataStorage'.static.GetObj(class'DXRando'.default.dxr);
refusals = datastorage.GetConfigKey("item_refusals");
leftPart = Left(refusals, strIdx);
rightPart = Right(refusals, Len(refusals) - (strIdx + Len(type.name) + 1));
refusals = leftPart $ rightPart;

datastorage.SetConfig("item_refusals", refusals, 3600*24*366);
}

static function SetRefuseItem(class<Inventory> type)
{
local DataStorage datastorage;
local string refusals;

if (IsRefused(type))
if (storage == None) {
storage = class'DataStorage'.static.GetObj(class'DXRando'.default.dxr);
}
if (GetLootAction(itemClass, storage, lootActions, strIdx) == action) {
return;
}

datastorage = class'DataStorage'.static.GetObj(class'DXRando'.default.dxr);
refusals = datastorage.GetConfigKey("item_refusals");

if (refusals == "") refusals = ",";
refusals = refusals $ type.name $ ",";

datastorage.SetConfig("item_refusals", refusals, 3600*24*366);
if (lootActions == "") {
lootActions = "," $ itemClass.name $ "=" $ action $ ",";
} else if (strIdx == -1) {
lootActions = lootActions $ itemClass.name $ "=" $ action $ ",";
} else {
leftPart = Left(lootActions, strIdx + Len(itemClass.name) + 2);
rightPart = Mid(lootActions, strIdx + Len(itemClass.name) + 3);
lootActions = leftPart $ action $ rightPart;
}
storage.SetConfig("loot_actions", lootActions, 3600*24*366);
}

function RunTests()
Expand Down
23 changes: 15 additions & 8 deletions DXRVanilla/DeusEx/Classes/PersonaScreenInventory.uc
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,17 @@ function EnableButtons()
inv = Inventory(selectedItem.GetClientObject());

if (inv != None) {
if (class'DXRLoadouts'.static.IsRefused(inv.class)) {
btnRefusal.SetButtonText(AcceptLabel);
} else {
btnRefusal.SetButtonText(RefuseLabel);
switch (class'DXRLoadouts'.static.GetLootAction(inv.class)) {
case 0:
btnRefusal.SetButtonText(RefuseLabel);
break;
case 1:
btnRefusal.SetButtonText(AcceptLabel);
break;
case 2:
btnRefusal.SetButtonText(RefuseLabel);
btnRefusal.DisableWindow();
Die4Ever marked this conversation as resolved.
Show resolved Hide resolved
break;
}

if (NanoKeyRing(inv) != None) {
Expand Down Expand Up @@ -240,9 +247,9 @@ function UnsetRefuseItem()
local Inventory item;

item = Inventory(selectedItem.GetClientObject());
if(item == None) return;
if (item == None) return;

class'DXRLoadouts'.static.UnsetRefuseItem(item.class);
class'DXRLoadouts'.static.SetLootAction(item.class, 0);
btnRefusal.SetButtonText(RefuseLabel);
player.ClientMessage(item.ItemName $ " set as not trash.");
}
Expand All @@ -254,9 +261,9 @@ function SetRefuseItem()
local Vector dropVect;

item = Inventory(selectedItem.GetClientObject());
if(item == None) return;
if (item == None) return;

class'DXRLoadouts'.static.SetRefuseItem(item.class);
class'DXRLoadouts'.static.SetLootAction(item.class, 1);

if (Pickup(item) == None) {
DropSelectedItem();
Expand Down
86 changes: 58 additions & 28 deletions DXRVanilla/DeusEx/Classes/Player.uc
Original file line number Diff line number Diff line change
Expand Up @@ -532,34 +532,42 @@ function bool CanInstantLeftClick(DeusExPickup item)
exec function ParseLeftClick()
{
local DeusExPickup item;
local Actor A;
local int i;

Super.ParseLeftClick();
item = DeusExPickup(FrobTarget);
if (item != None && CanInstantLeftClick(item))
{
foreach item.BasedActors(class'Actor', A)
A.SetBase(None);
// So that any effects get applied to you
item.SetOwner(self);
item.SetBase(self);
// add to the player's inventory, so ChargedPickups travel across maps
item.BecomeItem();
item.bDisplayableInv = false;
item.Inventory = Inventory;
Inventory = item;
if(FireExtinguisher(item) != None) {
// this was buggy with multiple, but it doesn't make sense and wouldn't be useful to use multiple at once anyways
item.NumCopies = 1;
}
for(i=item.NumCopies; i > 0; i--) {
item.Activate();
}
InstantlyUseItem(item);
FrobTarget = None;
}
}

function InstantlyUseItem(DeusExPickup item)
{
local Actor A;
local int i;

if(item == None) return;

foreach item.BasedActors(class'Actor', A)
A.SetBase(None);
// So that any effects get applied to you
item.SetOwner(self);
item.SetBase(self);
// add to the player's inventory, so ChargedPickups travel across maps
item.BecomeItem();
item.bDisplayableInv = false;
item.Inventory = Inventory;
Inventory = item;
if(FireExtinguisher(item) != None) {
// this was buggy with multiple, but it doesn't make sense and wouldn't be useful to use multiple at once anyways
item.NumCopies = 1;
}
for(i=item.NumCopies; i > 0; i--) {
item.Activate();
}
}

exec function ParseRightClick()
{
local bool handled;
Expand Down Expand Up @@ -1682,23 +1690,45 @@ exec function PlayerRot()
ClientMessage("Player rotation: (" $ Rotation.pitch $ ", " $ Rotation.yaw $ ", " $ Rotation.roll $ ")");
}

exec function ShowRefused()
exec function LootActions()
{
local string refusals, msg;
local string lootActions, msg;
local int idx;

refusals = class'DataStorage'.static.GetObj(GetDXR()).GetConfigKey("item_refusals");
lootActions = class'DataStorage'.static.GetObj(GetDXR()).GetConfigKey("loot_actions");

// basically just adds a space after every comma
while (Len(refusals) > 1) {
refusals = Right(refusals, Len(refusals) - 1);
idx = InStr(refusals, ",");
msg = msg $ Left(refusals, idx) $ ", ";
refusals = Right(refusals, Len(refusals) - idx);
lootActions = Mid(lootActions, 1);
while (lootActions != "") {
idx = InStr(lootActions, ",");
msg = msg $ Left(lootActions, idx) $ ", ";
lootActions = Mid(lootActions, idx + 1);
}
msg = Left(msg, Len(msg) - 2);

ClientMessage("Refused items: " $ msg);
ClientMessage("Loot actions: " $ msg);
}

function bool ConsumableWouldHelp(Inventory item) {
Die4Ever marked this conversation as resolved.
Show resolved Hide resolved
if (health < default.health) {
if (MedKit(item) != None || SoyFood(item) != None || Candybar(item) != None || Sodacan(item) != None) {
return true;
}
if (HealingItem(item) != None && HealingItem(item).health > 0) {
return true;
}
}

if (energy < default.energy) {
if (BioElectricCell(item) != None) {
return true;
}
if (HealingItem(item) != None && HealingItem(item).energy > 0) {
return true;
}
}

return false;
}


Expand Down
26 changes: 0 additions & 26 deletions GUI/DeusEx/Classes/MenuChoice_ItemRefusal.uc

This file was deleted.

33 changes: 33 additions & 0 deletions GUI/DeusEx/Classes/MenuChoice_LootAction.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
class MenuChoice_LootAction extends DXRMenuUIChoiceInt;
#compileif injections

var class<Inventory> itemClasses[5];

static function SetActions()
{
local class<Inventory> itemClass;
local DataStorage storage;
local int i;

storage = class'DataStorage'.static.GetObj(class'DXRando'.default.dxr);
for (i = 0; i < ArrayCount(default.itemClasses); i++) {
itemClass = default.itemClasses[i];
if (itemClass == None)
continue;
class'DXRLoadouts'.static.SetLootAction(itemClass, default.value, storage);
}
}

function SaveSetting()
{
Super.SaveSetting();
SetActions();
}

defaultproperties
{
value=0
defaultvalue=0
enumText(0)="Pick Up"
enumText(1)="Drop"
}
13 changes: 13 additions & 0 deletions GUI/DeusEx/Classes/MenuChoice_LootActionAlcohol.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class MenuChoice_LootActionAlcohol extends MenuChoice_LootAction;
#compileif injections

defaultproperties
{
HelpText="Should alcohol be included in the list of Junk items that get dropped when looting a body, or get consumed automatically?"
actionText="Alcohol"

itemClasses(0)=class'Liquor40oz'
itemClasses(1)=class'LiquorBottle'
itemClasses(2)=class'WineBottle'
enumText(2)="Consume"
}
13 changes: 13 additions & 0 deletions GUI/DeusEx/Classes/MenuChoice_LootActionFoodSoda.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class MenuChoice_LootActionFoodSoda extends MenuChoice_LootAction;
#compileif injections

defaultproperties
{
HelpText="Should food and soda be included in the list of Junk items that get dropped when looting a body, or get consumed automatically?"
actionText="Food and Soda"

itemClasses(0)=class'SoyFood'
itemClasses(1)=class'Candybar'
itemClasses(2)=class'Sodacan'
enumText(2)="Consume"
}
16 changes: 16 additions & 0 deletions GUI/DeusEx/Classes/MenuChoice_LootActionMelee.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class MenuChoice_LootActionMelee extends MenuChoice_LootAction;
#compileif injections

defaultproperties
{
value=1
defaultvalue=1
HelpText="Should melee weapons be included in the list of Junk items that get dropped when looting a body?"
actionText="Melee Weapons"
Die4Ever marked this conversation as resolved.
Show resolved Hide resolved

itemClasses(0)=class'WeaponCombatKnife'
itemClasses(1)=class'WeaponCrowbar'
itemClasses(2)=class'WeaponSword'
itemClasses(3)=class'WeaponNanoSword'
itemClasses(4)=class'WeaponBaton'
}
Loading