Package com.prineside.tdi2.gameplayMods
Class GenericGameplayMod
java.lang.Object
com.prineside.tdi2.gameplayMods.GenericGameplayMod
- All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable
,GameplayMod
- Direct Known Subclasses:
AbstractGameValueMod
,AddAllAbilityCharges
,AddRandomCoreTile
,AddRandomPlatform
,AllAbilitiesForRandomTower
,BaseExplodesOnEnemyPass
,BoostExistingEnemiesWithLoot
,BuildRandomMiner
,CriticalDamage
,DebuffsLastLonger
,DepositCoinsGeneration
,DoubleMiningSpeed
,EnemiesDropResources
,ExtraDamagePerBuff
,FirstEnemiesInWaveExplode
,IncreasedTowerToEnemyEfficiency
,IncreaseSelectedBonusesPower
,LastEnemiesInWaveDealNoDamage
,LightningStrikeOnTowerLevelUp
,LowHpEnemiesDealNoDamage
,MinedItemsTurnIntoDust
,MineLegendaryItems
,MinersSpawnEnemies
,MoreBonusVariantsNextTime
,MultiplyLootedItems
,MultiplyMdps
,NukeOnBonusStage
,ReceiveCoins
,ReceiveGreenPapers
,SellAllTowers
,SpawnZombiesFromBase
,SummonLootBoss
,TowersAttackSpeed
,TowersDamage
,TriggerRandomAbility
public abstract class GenericGameplayMod
extends Object
implements GameplayMod, com.esotericsoftware.kryo.KryoSerializable
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
boolean
int
com.badlogic.gdx.utils.IntArray
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
applyConfig
(com.badlogic.gdx.utils.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 combogetId()
Used to identify and compare mods instead of comparing mod classes and variants (if mod allows multiple variants) For example, GameValueMod may have many variants and should generate a separate id for each oneint
int
getPower()
boolean
isPowerLevelUpgradedByOtherMod
(int level) void
markPowerLevelUpgradedByOtherMod
(int level) Called when some specific mods upgrade other mods To make it clear for the player which bonuses were affected, these levels are marked with a different colorvoid
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) void
setRegisteredPower
(int newPower) If mod has adjustable power, this method can be called during the game to increase its powervoid
setReplacesUnsatisfiedMod
(GameplayMod replacedMod) Mark this mod as a replacement for some other mod whose preconditions were not satisfiedvoid
write
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) 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, getAdditionalCategory, getCategory, getDescription, getIcon, getNotSatisfiedPreconditions, isImmediateAndNotListed, register
-
Field Details
-
maxPower
public int maxPower -
power
public int power -
multipleInstances
public boolean multipleInstances -
powerLevelsUpgradedByMods
public com.badlogic.gdx.utils.IntArray powerLevelsUpgradedByMods -
replacedMod
-
-
Constructor Details
-
GenericGameplayMod
public GenericGameplayMod()
-
-
Method Details
-
write
public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) - Specified by:
write
in interfacecom.esotericsoftware.kryo.KryoSerializable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
read
in interfacecom.esotericsoftware.kryo.KryoSerializable
-
getId
Description copied from interface:GameplayMod
Used to identify and compare mods instead of comparing mod classes and variants (if mod allows multiple variants) For example, GameValueMod may have many variants and should generate a separate id for each one- Specified by:
getId
in interfaceGameplayMod
-
setReplacesUnsatisfiedMod
Description copied from interface:GameplayMod
Mark this mod as a replacement for some other mod whose preconditions were not satisfied- Specified by:
setReplacesUnsatisfiedMod
in interfaceGameplayMod
-
getReplacesUnsatisfiedMod
- Specified by:
getReplacesUnsatisfiedMod
in interfaceGameplayMod
- Returns:
- mod previously set by setReplacesUnsatisfiedMod()
-
markPowerLevelUpgradedByOtherMod
public void markPowerLevelUpgradedByOtherMod(int level) Description copied from interface:GameplayMod
Called when some specific mods upgrade other mods To make it clear for the player which bonuses were affected, these levels are marked with a different color- Specified by:
markPowerLevelUpgradedByOtherMod
in interfaceGameplayMod
-
isPowerLevelUpgradedByOtherMod
public boolean isPowerLevelUpgradedByOtherMod(int level) - Specified by:
isPowerLevelUpgradedByOtherMod
in interfaceGameplayMod
-
allowsMultipleInstancesFromDifferentSources
public boolean allowsMultipleInstancesFromDifferentSources()- Specified by:
allowsMultipleInstancesFromDifferentSources
in interfaceGameplayMod
- Returns:
- true if multiple mods of the same type can be enabled at the same time (from different sources)
-
getPower
public int getPower()- Specified by:
getPower
in interfaceGameplayMod
- Returns:
- current power of the mod. Higher power makes mod more effective
-
getMaxPower
public int getMaxPower()- Specified by:
getMaxPower
in interfaceGameplayMod
- Returns:
- max possible power of the mod. If set to <=1f, it is assumed that mod has a single fixed power
-
setRegisteredPower
public void setRegisteredPower(int newPower) 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
- Parameters:
newPower
- new power to set for this mod when already registered. Will be in range 0..getMaxPower()
-
applyConfig
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
-