From 37ab80b566190c15b23f635e38fe8ebe6a29697d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Jun 2006 20:54:39 +0000 Subject: [PATCH] - Changed UpgradeStamina to use AInventory's Amount and MaxAmount to control the amount of upgrade and the maximum that can be reached. SVN r186 (trunk) --- docs/rh-log.txt | 4 ++++ src/g_strife/a_strifeitems.cpp | 12 +++++++++--- src/g_strife/a_strifeweapons.cpp | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index ae1d4a3b0..c2c7dc4d2 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,7 @@ +June 11, 2006 (Changes by Graf Zahl) +- Changed UpgradeStamina to use AInventory's Amount and MaxAmount to + control the amount of upgrade and the maximum that can be reached. + June 10, 2006 (Changes by Graf Zahl) - Fixed: The skin loader assumed that all skin textures are in Doom patch format. Now it calls FTexture::CreateTexture to do proper checks. diff --git a/src/g_strife/a_strifeitems.cpp b/src/g_strife/a_strifeitems.cpp index c268528ee..6e406dd31 100644 --- a/src/g_strife/a_strifeitems.cpp +++ b/src/g_strife/a_strifeitems.cpp @@ -485,14 +485,20 @@ IMPLEMENT_STATELESS_ACTOR (AUpgradeStamina, Strife, -1, 0) PROP_StrifeType (306) PROP_StrifeTeaserType (287) PROP_StrifeTeaserType2 (307) + PROP_Inventory_Amount (10) + PROP_Inventory_MaxAmount (100) END_DEFAULTS bool AUpgradeStamina::TryPickup (AActor *toucher) { - if (toucher->player == NULL || toucher->player->stamina >= 100) + if (toucher->player == NULL) return false; - toucher->player->stamina += 10; - P_GiveBody (toucher, 200); + + toucher->player->stamina += Amount; + if (toucher->player->stamina >= MaxAmount) + toucher->player->stamina = MaxAmount; + + P_GiveBody (toucher, -100); GoAwayAndDie (); return true; } diff --git a/src/g_strife/a_strifeweapons.cpp b/src/g_strife/a_strifeweapons.cpp index 88c4682a6..6e15e3897 100644 --- a/src/g_strife/a_strifeweapons.cpp +++ b/src/g_strife/a_strifeweapons.cpp @@ -198,7 +198,7 @@ void A_JabDagger (AActor *actor) int pitch; int power; - power = actor->player->stamina / 10; + power = MIN(10, actor->player->stamina / 10); damage = (pr_jabdagger() % (power + 8)) * (power + 2); if (actor->FindInventory())