diff --git a/sprite workspace/FLBLA0.xcf b/sprite workspace/FLBLA0.xcf deleted file mode 100644 index 2a3d19d..0000000 Binary files a/sprite workspace/FLBLA0.xcf and /dev/null differ diff --git a/src/CVARINFO.txt b/src/CVARINFO.txt index 4776fec..7d5f7ab 100644 --- a/src/CVARINFO.txt +++ b/src/CVARINFO.txt @@ -34,6 +34,8 @@ server int flashlight_battery_max = 1575; server int flashlight_battery_min_threshold = 315; server int flashlight_battery_use_per_tic = 1; server int flashlight_battery_charge_per_tic = 3; +server int flashlight_battery_recharge_max_amount = 30; +server int flashlight_battery_upgrade_max_amount = 30; //map alteration server int flashlight_darken_mode = 0; diff --git a/src/LANGUAGE.enu b/src/LANGUAGE.enu index ac4a86e..be80ffd 100644 --- a/src/LANGUAGE.enu +++ b/src/LANGUAGE.enu @@ -135,6 +135,9 @@ FLASHLIGHT_BATTERY_USE = "Battery Use Rate (tics)"; FLASHLIGHT_BATTERY_CHARGE = "Battery Charge Rate (tics)"; FLASHLIGHT_BATTERY_DESC1 = "Battery is required to use the flashlight."; FLASHLIGHT_BATTERY_DESC2 = "Flashlight can not be reactivated below the minumum."; +FLASHLIGHT_BATTERY_RECHARGE_INVENTORY_MAX = "Maximum Batteries"; +FLASHLIGHT_BATTERY_UPGRADE_INVENTORY_MAX = "Maximum Battery Upgrades"; +FLASHLIGHT_BATTERY_INVENTORY_MAX_DESC = "The maximum number of batteries and battery upgrades the player can carry"; //Darken Modes and Level Alteration FLASHLIGHT_DARKEN_MODE = "Light Alteration Mode"; diff --git a/src/MENUDEF.txt b/src/MENUDEF.txt index 9891345..1efec99 100644 --- a/src/MENUDEF.txt +++ b/src/MENUDEF.txt @@ -184,6 +184,9 @@ OptionMenu "FlashlightGameplayOptions" FlashlightSlider "$FLASHLIGHT_BATTERY_CHARGE", "flashlight_battery_charge_per_tic", 0,100,1,0,"flashlight_battery_mode","$FLASHLIGHT_MENU_NOOP" StaticText "$FLASHLIGHT_BATTERY_DESC1" StaticText "$FLASHLIGHT_BATTERY_DESC2" + ScaleSlider "$FLASHLIGHT_BATTERY_RECHARGE_INVENTORY_MAX", "flashlight_battery_recharge_max_amount", 0,100,1,"$FLASHLIGHT_UNLIMITED" + ScaleSlider "$FLASHLIGHT_BATTERY_UPGRADE_INVENTORY_MAX", "flashlight_battery_upgrade_max_amount", 0,100,1,"$FLASHLIGHT_UNLIMITED" + StaticText "$FLASHLIGHT_BATTERY_INVENTORY_MAX_DESC" } OptionMenu "FlashlightLightingOptions" diff --git a/src/zsc/Battery.zsc b/src/zsc/Battery.zsc index df52e39..d72929c 100644 --- a/src/zsc/Battery.zsc +++ b/src/zsc/Battery.zsc @@ -16,7 +16,7 @@ class Battery : Inventory updateFromCVars(); battery_level = GetMax(); } - + protected int numBatteryRecharges() { int re; diff --git a/src/zsc/BatteryUpgrades.zsc b/src/zsc/BatteryUpgrades.zsc index 858db1e..393b3ec 100644 --- a/src/zsc/BatteryUpgrades.zsc +++ b/src/zsc/BatteryUpgrades.zsc @@ -14,8 +14,8 @@ class FlashlightBatteryUpgrade : Inventory +COUNTITEM; Inventory.PickupSound "misc/gettool" ; Inventory.PickupMessage "$FLASHLIGHT_BATT_EXP_PICKUP"; - Inventory.InterHubAmount 10; - Inventory.MaxAmount 10; + Inventory.InterHubAmount 999; + Inventory.MaxAmount 999; Inventory.Amount 1; Scale 0.4; } @@ -25,6 +25,12 @@ class FlashlightBatteryUpgrade : Inventory CELP A -1; Loop; } + + override bool CanPickup(Actor toucher) + { + bool allow = flashlight_battery_upgrade_max_amount <= 0 || toucher.CountInv("FlashlightBatteryUpgrade") < flashlight_battery_upgrade_max_amount; + return allow && super.CanPickup(toucher); + } } class FlashlightBatteryRecharge : FlashlightBatteryUpgrade @@ -33,4 +39,10 @@ class FlashlightBatteryRecharge : FlashlightBatteryUpgrade { Inventory.PickupMessage "$FLASHLIGHT_BATT_PICKUP"; } + + override bool CanPickup(Actor toucher) + { + bool allow = flashlight_battery_recharge_max_amount <= 0 || toucher.CountInv("FlashlightBatteryRecharge") < flashlight_battery_recharge_max_amount; + return allow && super.CanPickup(toucher); + } } diff --git a/src/zsc/Flares.zsc b/src/zsc/Flares.zsc index 234e04c..4c4e802 100644 --- a/src/zsc/Flares.zsc +++ b/src/zsc/Flares.zsc @@ -8,8 +8,8 @@ class Flare : CustomInventory +INVENTORY.HUBPOWER; +INVENTORY.PERSISTENTPOWER; +DONTGIB; - Inventory.MaxAmount 9999; - Inventory.InterHubAmount 9999; + Inventory.MaxAmount 999; + Inventory.InterHubAmount 999; Inventory.Icon "FLARINV"; Inventory.PickupMessage "You picked up a flare."; }