From 3fb91ba6e1e34c70cf9f32258fc137e60dbe3ea4 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Thu, 2 Jun 2016 11:35:58 +1000 Subject: [PATCH] Change weapon stamina loss to be BASELOSS + 3*weapon_attackdelay_mod ie. weapon attack delay of 130 = 190% of base stamina loss. This should mitigate powerful weapons like halberds. Make innate 'fists' type objects have the same fast attack speed as a dagger. --- data.c | 7 +++++++ lf.c | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/data.c b/data.c index 34876c4..03a9b4f 100644 --- a/data.c +++ b/data.c @@ -8835,6 +8835,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_UNARMED, NA, NA, NULL); addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 1, NA, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 75, NA, NA, NULL); addot(OT_AIRFISTS, "air currents", "air currents object", MT_GAS, 0, OC_WEAPON, SZ_TINY); addflag(lastot->flags, F_DAM, DT_BASH, 2, NA, NULL); @@ -8852,6 +8853,7 @@ void initobjects(void) { addflag(lastot->flags, F_ATTACKVERB, NA, 2, NA, "scratch"); addflag(lastot->flags, F_ATTACKVERB, 3, 6, NA, "scrape"); addflag(lastot->flags, F_ATTACKVERB, 7, NA, NA, "rake"); + addflag(lastot->flags, F_OBATTACKDELAY, 75, NA, NA, NULL); addot(OT_TEETH, "teeth", "teeth object", MT_BONE, 0, OC_WEAPON, SZ_TINY); @@ -8861,6 +8863,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 3, NA, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 75, NA, NA, NULL); addot(OT_TRAMPLE, "trample", "trample object", MT_BONE, 0, OC_WEAPON, SZ_TINY); addflag(lastot->flags, F_DAM, DT_CRUSH, 2, NA, NULL); @@ -8876,6 +8879,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_ATTACKVERB, NA, NA, NA, "peck"); + addflag(lastot->flags, F_OBATTACKDELAY, 75, NA, NA, NULL); addot(OT_DRILL, "drills", "drills object", MT_METAL, 0, OC_WEAPON, SZ_TINY); addflag(lastot->flags, F_DAM, DT_SLASH, 2, NA, NULL); @@ -8898,6 +8902,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 75, NA, NA, NULL); addot(OT_SAWBLADE, "sawblade", "sawblade object", MT_BONE, 0, OC_WEAPON, SZ_TINY); addflag(lastot->flags, F_DAM, DT_SLASH, 2, NA, NULL); @@ -8952,6 +8957,7 @@ void initobjects(void) { addflag(lastot->flags, F_USESSKILL, SK_NONE, NA, NA, NULL); addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_CRITCHANCE, 5, NA, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 75, NA, NA, NULL); addot(OT_TENTACLE, "tentacle", "tentacle object", MT_FLESH, 0, OC_WEAPON, SZ_TINY); addflag(lastot->flags, F_DAM, DT_BASH, 10, NA, NULL); @@ -8973,6 +8979,7 @@ void initobjects(void) { addflag(lastot->flags, F_NOSTRDAMMOD, B_TRUE, NA, NA, NULL); addflag(lastot->flags, F_USESSKILL, SK_WHIPS, NA, NA, NULL); addflag(lastot->flags, F_UNARMEDWEP, B_TRUE, NA, NA, NULL); + addflag(lastot->flags, F_OBATTACKDELAY, 75, NA, NA, NULL); addot(OT_ZAPPER, "zapper", "zapper object", MT_NOTHING, 0, OC_WEAPON, SZ_TINY); addflag(lastot->flags, F_DAM, DT_ELECTRIC, 2, NA, NULL); diff --git a/lf.c b/lf.c index bbc10ac..d031d0a 100644 --- a/lf.c +++ b/lf.c @@ -7802,9 +7802,12 @@ float getattackstamloss(lifeform_t *lf) { w = getweapon(lf); if (w) { - int del; - del = getobattackdelay(w); - loss = pctof(del, loss); + int pctmod; + pctmod = getobattackdelay(w); // ie. 50 is fast, 100 is normal, 150 is slow, etc. + pctmod -= 100; // ie. -50 is fast, 0 is normal, 50 is slow + + // ie. normal attack stamina cost, plus twice the weapon's "attack delay" + loss = loss + (pctof(pctmod, loss)*3); } return loss;