Class AbstractGameValueMod
java.lang.Object
com.prineside.tdi2.gameplayMods.GenericGameplayMod
com.prineside.tdi2.gameplayMods.mods.AbstractGameValueMod
- All Implemented Interfaces:
KryoSerializable
,GameplayMod
- Direct Known Subclasses:
GV_AbilitiesEnergy
,GV_AbilitiesMaxEnergy
,GV_BountiesNearby
,GV_DisableBountyModifierHarm
,GV_MinersMaxUpgradeLevel
,GV_TowersMaxExpLevel
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloat
float
boolean
boolean
Fields inherited from class com.prineside.tdi2.gameplayMods.GenericGameplayMod
maxPower, multipleInstances, power, powerLevelsUpgradedByMods, replacedMod
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractGameValueMod
(GameValueType gvType) AbstractGameValueMod
(GameValueType gvType, float baseValue, float deltaPerPower, boolean roundToInt, GameplayModCategory mainCategory, GameplayModCategory additionalCategory) -
Method Summary
Modifier and TypeMethodDescriptionapplyConfig
(JsonValue cfg) Usually there's no need to override this method Used by mods that have specific combinations of parameters and read default parameters for each combogetIcon()
void
boolean
register
(GameSystemProvider S, String activatedBy) Note: if mod needs random number generator, it must use the one provided by GameplayModSystemvoid
setRegisteredPower
(int power) If mod has adjustable power, this method can be called during the game to increase its powervoid
Methods inherited from class com.prineside.tdi2.gameplayMods.GenericGameplayMod
allowsMultipleInstancesFromDifferentSources, getId, getMaxPower, getPower, getReplacesUnsatisfiedMod, isPowerLevelUpgradedByOtherMod, markPowerLevelUpgradedByOtherMod, setReplacesUnsatisfiedMod
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.prineside.tdi2.gameplayMods.GameplayMod
configure, cpy, getNotSatisfiedPreconditions, isAlwaysUseless, isImmediateAndNotListed
-
Field Details
-
gvType
-
mainCategory
-
additionalCategory
-
baseValue
public float baseValue -
deltaPerPower
public float deltaPerPower -
roundToInt
public boolean roundToInt -
isFinalMultiplier
public boolean isFinalMultiplier
-
-
Constructor Details
-
AbstractGameValueMod
-
AbstractGameValueMod
public AbstractGameValueMod(GameValueType gvType, float baseValue, float deltaPerPower, boolean roundToInt, GameplayModCategory mainCategory, @Null GameplayModCategory additionalCategory)
-
-
Method Details
-
write
- Specified by:
write
in interfaceKryoSerializable
- Overrides:
write
in classGenericGameplayMod
-
read
- Specified by:
read
in interfaceKryoSerializable
- Overrides:
read
in classGenericGameplayMod
-
getIcon
-
applyConfig
Description copied from class:GenericGameplayMod
Usually there's no need to override this method Used by mods that have specific combinations of parameters and read default parameters for each combo- Overrides:
applyConfig
in classGenericGameplayMod
-
getDescription
-
register
Description copied from interface:GameplayMod
Note: if mod needs random number generator, it must use the one provided by GameplayModSystem- Returns:
- true if bonus has to be registered. False means that existing active mod of the same type has been upgraded
-
getCategory
-
getAdditionalCategory
-
setRegisteredPower
public void setRegisteredPower(int power) Description copied from interface:GameplayMod
If mod has adjustable power, this method can be called during the game to increase its power- Specified by:
setRegisteredPower
in interfaceGameplayMod
- Overrides:
setRegisteredPower
in classGenericGameplayMod
- Parameters:
power
- new power to set for this mod when already registered. Will be in range 0..getMaxPower()
-