Added Evil Turnip patch.

This commit is contained in:
ceikry 2021-07-25 11:08:12 -05:00
parent d7fbe05980
commit 0900c04309
4 changed files with 8 additions and 5 deletions

View file

@ -65,7 +65,8 @@ enum class FarmingPatch(val varpIndex: Int, val varpOffset: Int, val type: Patch
//Other
DRAYNOR_BELLADONNA(512, 16, PatchType.BELLADONNA),
ALKHARID_CACTUS(512, 0, PatchType.CACTUS);
ALKHARID_CACTUS(512, 0, PatchType.CACTUS),
EVIL_TURNIP(1171, 7, PatchType.EVIL_TURNIP);
companion object {
@JvmField

View file

@ -15,7 +15,7 @@ class Patch(val player: Player, val patch: FarmingPatch, var plantable: Plantabl
fun setNewHarvestAmount() {
if(patch.type == PatchType.ALLOTMENT){
harvestAmt = RandomFunction.random(4,17)
} else if(patch.type == PatchType.FLOWER) {
} else if(patch.type == PatchType.FLOWER || patch.type == PatchType.EVIL_TURNIP) {
harvestAmt = when (plantable) {
Plantable.LIMPWURT_SEED, Plantable.WOAD_SEED -> 3
else -> 1
@ -163,7 +163,7 @@ class Patch(val player: Player, val patch: FarmingPatch, var plantable: Plantabl
CompostType.SUPER -> 13
}
if(RandomFunction.random(128) <= (17 - diseaseMod) && !isWatered && !isGrown() && !protectionPaid && !isFlowerProtected()){
if(RandomFunction.random(128) <= (17 - diseaseMod) && !isWatered && !isGrown() && !protectionPaid && !isFlowerProtected() && patch.type != PatchType.EVIL_TURNIP){
//bush, tree, fruit tree and cactus can not disease on stage 1(0) of growth.
if(!((patch.type == PatchType.BUSH || patch.type == PatchType.TREE || patch.type == PatchType.FRUIT_TREE || patch.type == PatchType.CACTUS) && currentGrowthStage == 0)) {
isDiseased = true

View file

@ -10,5 +10,6 @@ enum class PatchType(val stageGrowthTime: Int) {
HERB(20),
SPIRIT_TREE(293),
BELLADONNA(80),
CACTUS(60)
CACTUS(60),
EVIL_TURNIP(5)
}

View file

@ -77,7 +77,8 @@ enum class Plantable(val itemID: Int, val value: Int, val stages: Int, val plant
//Other
BELLADONNA_SEED(5281, 4, 4, 91.0, 128.0, 0.0, 63, PatchType.BELLADONNA, Items.CAVE_NIGHTSHADE_2398),
CACTUS_SEED(Items.CACTUS_SEED_5280, 8, 7, 66.5, 25.0, 374.0, 55, PatchType.CACTUS, Items.CACTUS_SPINE_6016)
CACTUS_SEED(Items.CACTUS_SEED_5280, 8, 7, 66.5, 25.0, 374.0, 55, PatchType.CACTUS, Items.CACTUS_SPINE_6016),
EVIL_TURNIP_SEED(Items.EVIL_TURNIP_SEED_12148, 4, 1, 41.0, 46.0, 0.0, 42, PatchType.EVIL_TURNIP, Items.EVIL_TURNIP_12134)
;
constructor(itemID: Int, value: Int, stages: Int, plantingXP: Double, harvestXP: Double, checkHealthXP: Double, requiredLevel: Int, applicablePatch: PatchType, harvestItem: Int, protectionFlower: Plantable)