Package com.prineside.tdi2
Class Enemy
java.lang.Object
com.prineside.tdi2.Registrable
com.prineside.tdi2.Enemy
- All Implemented Interfaces:
com.badlogic.gdx.utils.Pool.Poolable,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
public abstract class Enemy
extends Registrable
implements ScheduledUpdater.Updatable, com.badlogic.gdx.utils.Pool.Poolable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classUse 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 classEnemy.Factory<T extends Enemy> -
Field Summary
FieldsModifier and TypeFieldDescriptionfloatfloatbooleanfloatfloatfloatcom.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffectboolean[]com.badlogic.gdx.utils.DelayedRemovalArray[]booleanintbooleanbytecom.badlogic.gdx.utils.IntIntMapfloatcom.badlogic.gdx.utils.IntSetbooleanfloatbooleanfloatcom.badlogic.gdx.math.Vector2floatfloatbooleanstatic final com.badlogic.gdx.graphics.Colorbooleanfloatintbooleanbooleanintcom.badlogic.gdx.utils.Array<ItemStack>booleanfloatbooleanfloatintbooleanintstatic final floatfloatstatic final intcom.badlogic.gdx.utils.IntMapbooleanbooleanbooleanFields inherited from class com.prineside.tdi2.Registrable
S -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyDrawInterpolation(float interpolatedTime) booleancanBeAttackedBy(Tower tower) Дополнительная проверка, основная находится в tower.canAttackEnemyfinal booleancanBeBuffed(BuffType buff) booleanvoiddrawBatch(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime) voiddrawBatchAdditive(com.badlogic.gdx.graphics.g2d.Batch batch, float deltaTime) В основном подсветка удара врага и ауры Не вызывается, если партиклы отключеныvoiddrawHealth(com.badlogic.gdx.graphics.g2d.Batch batch) booleanfloatgetAbilityVulnerability(AbilityType abilityType) floatcom.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffectfloatgetBuffedDamageMultiplier(TowerType towerType, DamageType damageType) floatcom.badlogic.gdx.utils.DelayedRemovalArraygetBuffsByTypeOrNull(BuffType buffType) floatgetBuffVulnerability(BuffType buff) com.badlogic.gdx.graphics.ColorgetColor()com.badlogic.gdx.graphics.g2d.TextureRegionfloatcom.badlogic.gdx.graphics.g2d.TextureRegioncom.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffectfloatintfloatgetPassedTilesDelta(float deltaTime) Сколько тайлов пройдет враг за это время, исходя из текущей позицииcom.badlogic.gdx.math.Vector2floatgetSize()Радиус врага в пикселяхfloatgetSpeed()floatcom.badlogic.gdx.graphics.g2d.TextureRegionfloatgetTowerDamageMultiplier(TowerType towerType) getUserData(int idx) floatgiveDamage(Tower tower, float damage, DamageType damageType) Вызывать только через enemySystembooleanhasBuffsByType(BuffType buffType) abstract booleanvoidbooleanisAir()booleanisVulnerableTo(DamageType damageType) booleanisVulnerableToSpecial(SpecialDamageType damageType) voidВызывается, когда position устанавливается системой в соответствии с path и passedTiles.voidonPreDie()voidvoidread(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) voidreset()Resets the object for reuse.final intfinal voidscheduledUpdatableSetId(int id) voidscheduledUpdate(float deltaTime) voidsetHealth(float newHealth) voidsetKillExp(float exp) voidsetMaxHealth(float health) voidsetPosition(float x, float y) voidsetPosition(com.badlogic.gdx.math.Vector2 position) voidvoidsetSpeed(float newSpeed) voidvoidsetUserData(int idx, Object data) voidupdate(float deltaTime) voidwrite(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class com.prineside.tdi2.Registrable
isRegistered, setRegistered
-
Field Details
-
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 -
disabled
public boolean disabled -
visible
public boolean visible -
lowAimPriority
public boolean lowAimPriority -
angle
public float angle -
drawAngle
public float drawAngle -
drawScale
public float drawScale -
healthBarInvisible
public boolean healthBarInvisible -
drawPosition
public com.badlogic.gdx.math.Vector2 drawPosition -
type
-
maxHealth
public float maxHealth -
bounty
public float bounty -
healthBarScale
public float healthBarScale -
loot
-
id
public int id -
setUpByEnemySystem
public boolean setUpByEnemySystem -
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 -
userData
public com.badlogic.gdx.utils.IntMap userData -
buffsByType
public com.badlogic.gdx.utils.DelayedRemovalArray[] buffsByType -
buffsAppliedByType
public boolean[] buffsAppliedByType -
spawnTile
-
wave
-
ignoredByAutoWaveCall
public boolean ignoredByAutoWaveCall -
buffRegenerationParticle
public com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect buffRegenerationParticle -
buffFreezingPercent
public float buffFreezingPercent -
buffFreezingLightningLengthBonus
public float buffFreezingLightningLengthBonus -
buffFreezingPoisonDurationBonus
public float buffFreezingPoisonDurationBonus -
buffBlizzardActive
public boolean buffBlizzardActive -
buffSnowballHits
public int buffSnowballHits -
buffSnowballActive
public boolean buffSnowballActive -
buffThrowBackAffectedBy
public com.badlogic.gdx.utils.IntSet buffThrowBackAffectedBy -
buffStunCountByTower
public com.badlogic.gdx.utils.IntIntMap buffStunCountByTower -
buffStunCount
public byte buffStunCount -
buffStunImmunity
public float buffStunImmunity -
buffStunActive
public boolean buffStunActive -
wasStunnedByGauss
public boolean wasStunnedByGauss -
crusherTowerTarget
public boolean crusherTowerTarget -
crusherTowerVulnerability
public float crusherTowerVulnerability -
gaussMiningSpeedGiven
public boolean gaussMiningSpeedGiven -
wasAimedAtWithChainReactionBuff
public boolean wasAimedAtWithChainReactionBuff -
notAffectsWaveKillCounter
public boolean notAffectsWaveKillCounter
-
-
Method Details
-
write
public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) - Specified by:
writein interfacecom.esotericsoftware.kryo.KryoSerializable- Overrides:
writein classRegistrable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
readin interfacecom.esotericsoftware.kryo.KryoSerializable- Overrides:
readin classRegistrable
-
reset
public void reset()Description copied from interface:com.badlogic.gdx.utils.Pool.PoolableResets the object for reuse. Object references should be nulled and fields may be set to default values.- Specified by:
resetin interfacecom.badlogic.gdx.utils.Pool.Poolable
-
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:
scheduledUpdatableSetIdin interfaceScheduledUpdater.Updatable
-
scheduledUpdatableGetId
public final int scheduledUpdatableGetId()- Specified by:
scheduledUpdatableGetIdin interfaceScheduledUpdater.Updatable
-
scheduledUpdate
public void scheduledUpdate(float deltaTime) - Specified by:
scheduledUpdatein 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
-
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() -
setUnregistered
public void setUnregistered()- Overrides:
setUnregisteredin classRegistrable
-
onPositionSetToPath
public void onPositionSetToPath()Вызывается, когда position устанавливается системой в соответствии с path и passedTiles. Здесь можно откорректировать позицию. -
canBeBuffed
-
getBuffVulnerability
-
isVulnerableTo
-
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()
-