Package com.prineside.tdi2
Class Enemy
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.Enemy
- All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable
,ScheduledUpdater.Updatable
- Direct Known Subclasses:
ArmoredEnemy
,BossEnemy
,BrootEnemy
,ConstructorBossEnemy
,FastEnemy
,FighterEnemy
,GenericEnemy
,HealerEnemy
,HeliEnemy
,IcyEnemy
,JetEnemy
,LightEnemy
,MetaphorBossCreepEnemy
,MetaphorBossEnemy
,MobchainBossBodyEnemy
,MobchainBossCreepEnemy
,MobchainBossHeadEnemy
,RegularEnemy
,SnakeBossBodyEnemy
,SnakeBossHeadEnemy
,SnakeBossTailEnemy
,StrongEnemy
,ToxicEnemy
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Use this wrapper to store a reference to an enemy (always if there's a chance the enemy will become unregistered between the moment it is stored & stored reference is used in the code) No need to use as method argument / as local variable (if there's no chance for the enemy to become unregistered while it is being used locally)static class
Enemy.Factory<T extends Enemy>
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloat
static final String
com.badlogic.gdx.utils.ObjectMap<String,
com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect> float
float
float
float
boolean[]
com.badlogic.gdx.utils.DelayedRemovalArray[]
int
com.badlogic.gdx.utils.IntSet
boolean
float
com.badlogic.gdx.math.Vector2
float
float
boolean
static final com.badlogic.gdx.graphics.Color
boolean
float
int
int
float
boolean
boolean
int
com.badlogic.gdx.utils.Array<ItemStack>
float
com.badlogic.gdx.utils.IntIntMap
int
float
int
int
static final float
float
com.badlogic.gdx.utils.IntSet
int
static final int
boolean
boolean
Fields inherited from class com.prineside.tdi2.Registrable
S
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyDrawInterpolation
(float interpolatedTime) boolean
canBeAttackedBy
(Tower tower) Дополнительная проверка, основная находится в tower.canAttackEnemyfinal boolean
canBeBuffed
(BuffType buff) boolean
void
drawBatch
(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime) void
drawBatchAdditive
(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime) В основном подсветка удара врага и ауры Не вызывается, если партиклы отключеныvoid
drawHealth
(com.badlogic.gdx.graphics.g2d.Batch batch) boolean
float
getAbilityVulnerability
(AbilityType abilityType) float
com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect
float
getBuffedDamageMultiplier
(TowerType towerType, DamageType damageType) float
com.badlogic.gdx.utils.DelayedRemovalArray
getBuffsByTypeOrNull
(BuffType buffType) float
getBuffVulnerability
(BuffType buff) com.badlogic.gdx.graphics.Color
getColor()
com.badlogic.gdx.graphics.g2d.TextureRegion
float
com.badlogic.gdx.graphics.g2d.TextureRegion
com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect
float
int
float
getPassedTilesDelta
(float deltaTime) Сколько тайлов пройдет враг за это время, исходя из текущей позицииcom.badlogic.gdx.math.Vector2
float
getSize()
Радиус врага в пикселяхfloat
getSpeed()
float
com.badlogic.gdx.graphics.g2d.TextureRegion
float
getTowerDamageMultiplier
(TowerType towerType) getUserData
(String key) float
giveDamage
(Tower tower, float damage, DamageType damageType) Вызывать только через enemySystemboolean
hasBuffsByType
(BuffType buffType) abstract boolean
void
boolean
isAir()
boolean
boolean
boolean
isVulnerableTo
(DamageType damageType) boolean
isVulnerableToSpecial
(SpecialDamageType damageType) void
Вызывается, когда position устанавливается системой в соответствии с path и passedTiles.void
onPreDie()
void
void
read
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) final int
final void
scheduledUpdatableSetId
(int id) void
scheduledUpdate
(float deltaTime) void
setHealth
(float newHealth) void
setKillExp
(float exp) void
setMaxHealth
(float health) void
setPosition
(float x, float y) void
setPosition
(com.badlogic.gdx.math.Vector2 position) void
void
setSpeed
(float newSpeed) void
setUserData
(String idx, Object data) void
update
(float deltaTime) void
write
(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered, setUnregistered
-
Field Details
-
ATTACHED_PARTICLE_REGENERATION_BUFF
- See Also:
-
UNREGISTERED_ID
public static final int UNREGISTERED_ID- See Also:
-
HEALTH_BAR_BACKGROUND_COLOR
public static final com.badlogic.gdx.graphics.Color HEALTH_BAR_BACKGROUND_COLOR -
SIZE
public static final float SIZE- See Also:
-
killScore
public int killScore -
angle
public float angle -
drawAngle
public float drawAngle -
drawScale
public float drawScale -
healthBarInvisible
public boolean healthBarInvisible -
drawPosition
public com.badlogic.gdx.math.Vector2 drawPosition -
invisible
-
disabled
-
chasedByCrusher
public boolean chasedByCrusher -
gaveMiningSpeedForGauss
public boolean gaveMiningSpeedForGauss -
loot
-
thrownBackBy
public com.badlogic.gdx.utils.IntSet thrownBackBy -
ignitionProgress
public float ignitionProgress -
ignitionIncreasedLastFrame
public int ignitionIncreasedLastFrame -
notAffectsWaveKillCounter
-
lowAimPriority
-
caughtByCrushersSet
public com.badlogic.gdx.utils.IntSet caughtByCrushersSet -
totalCatchesByCrushers
public int totalCatchesByCrushers -
stunDebuffStats
-
attachedParticles
public com.badlogic.gdx.utils.ObjectMap<String,com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect> attachedParticles -
type
-
maxHealth
public float maxHealth -
bounty
public float bounty -
otherEnemiesNearby
public int otherEnemiesNearby -
healthBarScale
public float healthBarScale -
id
public int id -
graphPath
-
pathSearches
public int pathSearches -
ignorePathfinding
public boolean ignorePathfinding -
sideShiftIndex
public int sideShiftIndex -
passedTiles
public float passedTiles -
sumPassedTiles
public float sumPassedTiles -
existsTime
public float existsTime -
buffsByType
public com.badlogic.gdx.utils.DelayedRemovalArray[] buffsByType -
buffsAppliedByType
public boolean[] buffsAppliedByType -
spawnTile
-
wave
-
ignoredByAutoWaveCall
public boolean ignoredByAutoWaveCall -
buffFreezingPercent
public float buffFreezingPercent -
buffFreezingLightningLengthBonus
public float buffFreezingLightningLengthBonus -
buffFreezingPoisonDurationBonus
public float buffFreezingPoisonDurationBonus -
buffSnowballHits
public int buffSnowballHits -
multishotTowerHits
public com.badlogic.gdx.utils.IntIntMap multishotTowerHits -
wasAimedAtWithChainReactionBuff
public boolean wasAimedAtWithChainReactionBuff -
wasStunnedByGauss
public boolean wasStunnedByGauss
-
-
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
- Overrides:
write
in classRegistrable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
read
in interfacecom.esotericsoftware.kryo.KryoSerializable
- Overrides:
read
in classRegistrable
-
getUserData
-
setUserData
-
getCurrentTile
-
getColor
public com.badlogic.gdx.graphics.Color getColor() -
initBuffsByTypeArray
public void initBuffsByTypeArray() -
hasBuffsByType
- Returns:
- false if there are no buffs applied of the selected type. Buff arrays may not be allocated yet
-
getBuffsByTypeOrNull
-
update
public void update(float deltaTime) -
canHaveRandomSideShift
public boolean canHaveRandomSideShift() -
giveDamage
Вызывать только через enemySystem -
getSize
public float getSize()Радиус врага в пикселях -
getSquaredSize
public float getSquaredSize() -
scheduledUpdatableSetId
public final void scheduledUpdatableSetId(int id) - Specified by:
scheduledUpdatableSetId
in interfaceScheduledUpdater.Updatable
-
scheduledUpdatableGetId
public final int scheduledUpdatableGetId()- Specified by:
scheduledUpdatableGetId
in interfaceScheduledUpdater.Updatable
-
scheduledUpdate
public void scheduledUpdate(float deltaTime) - Specified by:
scheduledUpdate
in interfaceScheduledUpdater.Updatable
-
drawBatch
public void drawBatch(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime) -
drawBatchAdditive
public void drawBatchAdditive(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime) В основном подсветка удара врага и ауры Не вызывается, если партиклы отключены -
setPositionToPath
public void setPositionToPath() -
getPosition
public com.badlogic.gdx.math.Vector2 getPosition() -
setPosition
public void setPosition(com.badlogic.gdx.math.Vector2 position) -
setPosition
public void setPosition(float x, float y) -
applyDrawInterpolation
public void applyDrawInterpolation(float interpolatedTime) -
addLoot
- Returns:
- stack the item has been added into
-
getTexture
public com.badlogic.gdx.graphics.g2d.TextureRegion getTexture() -
getHighlightTexture
public com.badlogic.gdx.graphics.g2d.TextureRegion getHighlightTexture() -
getEmojiTexture
public com.badlogic.gdx.graphics.g2d.TextureRegion getEmojiTexture() -
drawHealth
public void drawHealth(com.badlogic.gdx.graphics.g2d.Batch batch) -
setHealth
public void setHealth(float newHealth) -
setKillExp
public void setKillExp(float exp) -
getKillExp
public float getKillExp() -
getKillScore
public int getKillScore() -
getHealth
public float getHealth() -
setMaxHealth
public void setMaxHealth(float health) -
setSpeed
public void setSpeed(float newSpeed) -
getSpeed
public float getSpeed() -
getPassedTilesDelta
public float getPassedTilesDelta(float deltaTime) Сколько тайлов пройдет враг за это время, исходя из текущей позиции -
getBuffedSpeed
public float getBuffedSpeed() -
getTowerDamageMultiplier
-
getBuffedDamageMultiplier
- Parameters:
towerType
- may be null
-
hasDrawPriority
public abstract boolean hasDrawPriority() -
getBaseDamage
public float getBaseDamage() -
onSpawned
public void onSpawned() -
onPreDie
public void onPreDie() -
onPositionSetToPath
public void onPositionSetToPath()Вызывается, когда position устанавливается системой в соответствии с path и passedTiles. Здесь можно откорректировать позицию. -
canBeBuffed
-
getBuffVulnerability
-
isVulnerableTo
-
isBossRelated
public boolean isBossRelated() -
isBossMainBodyPart
public boolean isBossMainBodyPart() -
isVulnerableToSpecial
-
getAbilityVulnerability
-
canBeAttackedBy
Дополнительная проверка, основная находится в tower.canAttackEnemy -
isAir
public boolean isAir() -
dynamicPathfindingAllowed
public boolean dynamicPathfindingAllowed() -
getBreakParticle
public com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect getBreakParticle() -
getHitParticle
public com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect getHitParticle()
-