1 //**************************************************************************
3 //** Copyright (C) 2021-2022 Ketmar Dark
5 //** This program is free software: you can redistribute it and/or modify
6 //** it under the terms of the GNU General Public License as published by
7 //** the Free Software Foundation, version 3 of the License ONLY.
9 //** This program is distributed in the hope that it will be useful,
10 //** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 //** GNU General Public License for more details.
14 //** You should have received a copy of the GNU General Public License
15 //** along with this program. If not, see <http://www.gnu.org/licenses/>.
17 //**************************************************************************
18 // this somewhat balances drops
19 class EntityExZanDCK : replaces(EntityEx, forceparents);
22 //==========================================================================
26 // called in `A_NoBlocking()`, to drop itemd from DropItemList
27 // can be disabled with a flag in `A_NoBlocking()`
28 // also, won't be called if `ShouldDropItems()` returned `false`
30 //==========================================================================
31 override void DropAllItems () {
32 bool hellClawSeen = false;
34 // check for monsters dropping things
35 float prb = GetCvarF('k8ZanMod_DropProbChaingun');
36 //printdebug("%C: DropAllItems! prb=%s", self, prb);
37 foreach (auto ref it; DropItemList) {
38 if (!it.Type) continue;
39 // replace most Chainguns with ammo
40 if (it.Type !isa Weapon) continue;
41 if ((it.Type isa 'Chaingun') || (GetClassReplacement(it.Type) isa 'Chaingun')) {
42 if (it.Amount > 1) it.Amount = 1;
43 // even if probability is zero, we still can have a VERY rare PainGun
44 if (FRandomFull() > prb) {
45 //printdebug("%C: replaced `%C` with `AmmoBelt`", self, it.Type);
49 } else if (cnt/9 == 0) {
56 } else if (!hellClawSeen && it.Type == Hellclaw) {
61 // Barons will sometimes drop Hellclaw
63 bool hb = ((self isa BaronOfHell) && !(self isa HellKnight));
64 // check for replacement too
66 auto rc = GetClassReplacee(self.Class);
67 //printdebug("%C: replacee is `%C`", self, rc);
68 if (rc && rc != self.Class) hb = ((rc isa BaronOfHell) && !(rc isa HellKnight));
72 prb = GetCvarF('k8ZanMod_DropProbBaronClaw');
73 if (FRandomFull() < prb) {
74 auto it = DropItemList.alloc();