-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rework Cradle sacrifice system to prefer to spawn hostile mobs …
…and occasionally anomalies This reworks how the tributes affect the spawning of flesh blobs and removes the spawning of malignant blobs when using living flesh.
- Loading branch information
1 parent
9399a51
commit 7a8bd97
Showing
6 changed files
with
177 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/main/java/com/github/elenterius/biomancy/block/cradle/Tribute.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package com.github.elenterius.biomancy.block.cradle; | ||
|
||
public record Tribute(int biomass, int lifeEnergy, int successModifier, int diseaseModifier, int hostileModifier, int anomalyModifier) implements ITribute { | ||
public Tribute(ITribute a, ITribute b) { | ||
this( | ||
a.biomass() + b.biomass(), | ||
a.lifeEnergy() + b.lifeEnergy(), | ||
a.successModifier() + b.successModifier(), | ||
a.diseaseModifier() + b.diseaseModifier(), | ||
a.hostileModifier() + b.hostileModifier(), | ||
a.anomalyModifier() + b.anomalyModifier() | ||
); | ||
} | ||
|
||
public static Tribute.Builder builder() { | ||
return new Tribute.Builder(); | ||
} | ||
|
||
public static class Builder { | ||
private int successModifier = 0; | ||
private int diseaseModifier = 0; | ||
private int hostileModifier = 0; | ||
private int biomass = 0; | ||
private int lifeEnergy = 0; | ||
private int anomalyModifier = 0; | ||
|
||
public Builder successModifier(int successModifier) { | ||
this.successModifier = successModifier; | ||
return this; | ||
} | ||
|
||
public Builder diseaseModifier(int diseaseModifier) { | ||
this.diseaseModifier = diseaseModifier; | ||
return this; | ||
} | ||
|
||
public Builder hostileModifier(int hostileModifier) { | ||
this.hostileModifier = hostileModifier; | ||
return this; | ||
} | ||
|
||
public Builder biomass(int biomass) { | ||
this.biomass = biomass; | ||
return this; | ||
} | ||
|
||
public Builder lifeEnergy(int lifeEnergy) { | ||
this.lifeEnergy = lifeEnergy; | ||
return this; | ||
} | ||
|
||
public Builder anomalyModifier(int anomalyModifier) { | ||
this.anomalyModifier = anomalyModifier; | ||
return this; | ||
} | ||
|
||
public ITribute create() { | ||
return new Tribute(biomass, lifeEnergy, successModifier, diseaseModifier, hostileModifier, anomalyModifier); | ||
} | ||
} | ||
} |
Oops, something went wrong.