From 49c3260dcc8cbfddcbc3b4d2516bf1cb4692afb9 Mon Sep 17 00:00:00 2001 From: onpon4 Date: Mon, 28 Nov 2016 00:21:11 -0500 Subject: [PATCH] Modified the way collectables are dropped. I've made a couple of improvements here: 1. There is now a limit to how much value can be in a single collectable. This means, most importantly, that there will be no more 1000 plasma collectables or anything else ridiculous like that. It also means that bosses now tend to drop a ton of different collectable objects. 2. Collectables dropped by ships now live longer if a lot of collectables were dropped. In practice, this only affects bosses; no normal enemy drops enough to trigger this. The combined results of these changes are that you're less likely to get stuck with a useless item when you kill a boss (such as plasma you don't need) rather than money, and you are more capable of collecting the huge wads of cash left behind by the bosses that drop more. --- src/alien.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/alien.cpp b/src/alien.cpp index 809d783..0651a49 100644 --- a/src/alien.cpp +++ b/src/alien.cpp @@ -1825,7 +1825,7 @@ void alien_destroy(Object *alien, Object *attacker) mission_updateRequirements(M_DESTROY_TARGET_TYPE, alien->classDef, 1); mission_updateRequirements(M_PROTECT_TARGET, alien->classDef, 1); - if (rand() % 100 <= alien->collectChance) + if (CHANCE(alien->collectChance / 100.)) { int value; @@ -1834,10 +1834,10 @@ void alien_destroy(Object *alien, Object *attacker) while (alien->collectValue > 0) { - value = (10 + (rand() % alien->collectValue)); + value = RANDRANGE(10, 100); if (value > alien->collectValue) value = alien->collectValue; - collectable_add(alien->x, alien->y, alien->collectType, value, 600); + collectable_add(alien->x, alien->y, alien->collectType, value, MAX(600, 2 * alien->collectValue)); alien->collectValue -= value; } }