[Gameplay] - Krampus spawns only ramp up to 1-2 instead of 2-3


rezecib

Recommended Posts

Bug Submission:

Category: Gameplay
Issue Title: Krampus spawns only ramp up to 2-3 instead of 3-4
Issue Description: Krampus is supposed to increase to 1-2 spawns after day 50, and 2-3 after day 100. Currently it only ever executes the first case.

 

The code in kramped right now is:

		if day > TUNING.KRAMPUS_INCREASE_LVL1 then			num_krampii = num_krampii + math.random(TUNING.KRAMPUS_INCREASE_RAMP)		elseif day > TUNING.KRAMPUS_INCREASE_LVL2 then			num_krampii = num_krampii + 1 + math.random(TUNING.KRAMPUS_INCREASE_RAMP)		end

but if day > 100, then day is also greater than 50, so only the first case ever occurs. It should be flipped to:

		if day > TUNING.KRAMPUS_INCREASE_LVL2 then			num_krampii = num_krampii + 1 + math.random(TUNING.KRAMPUS_INCREASE_RAMP)		elseif day > TUNING.KRAMPUS_INCREASE_LVL1 then			num_krampii = num_krampii + math.random(TUNING.KRAMPUS_INCREASE_RAMP)		end

Steps to Reproduce: You don't really need to, but have a world with lots of days... kill some birds (e.g. with Wickerbottom's Birds of the World + Sleepytime Stories), etc.

 

Edit: added code snippets

Edit2: I had been assuming math.random(m) worked like math.random()*m, but upon looking it up I see it generates an integer in the range [1,m]. I updated the krampus numbers to match in the issue description, but the title is wrong.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.