internal void addBuff(Buff b) { buffs.addBuff(b); }
internal override void Update(double gameTime) { base.Update(gameTime); //if(isAnimating()) return; //melee if (chargeTarget != null && !chargeTarget.isDead() ){ if (!isMoving() && !checkRangeAndMove(chargeTarget.getMid(), MELEE_RANGE, gameTime) && enemyCooldowns[(int)cooldowns.melee].use(gameTime)) { InGame.getInstance().addProjectile(new Projectile(this, getMid(), chargeTarget, doMelee, null, new IntRect())); model.setAnimation(attackAnimation); if (charging) stopCharge(); overrideDirection = getDirectionOfUnit(chargeTarget); } }else if (aggro != null && !isMoving() && enemyCooldowns[(int)cooldowns.melee].use(gameTime) && !checkRangeAndMove(aggro.getMid(), MELEE_RANGE, gameTime)) { InGame.getInstance().addProjectile(new Projectile(this, getMid(), aggro, doMelee, null, new IntRect())); model.setAnimation(attackAnimation); } //hungry if (hungered == null && enemyCooldowns[(int)cooldowns.hungry].ready(gameTime)) { hungered = new Buff(BuffType.physicalHaste, HUNGERED_RAGE_HASTE_PERCENT); buffs.addBuff(hungered); InGame.getInstance().setWarningFG(hungeredwarningTexture); model.setRing(Color.Red); InGame.getInstance().addScreenNote("HUNGERED RAGEE"); Console.WriteLine("hungered rage"); } //fish if (hungered != null && !model.isAnimating() && InGame.getDistance(this.getMid(), fish.getMid()) < FISHING_DIST) { Console.WriteLine("fish"); doFishEating(gameTime); } //charge (check if tank is back in range, to pick up aggro? if (!charging && chargeTarget != null) { if (InGame.getDistance(this.getMid(), aggro.getMid()) < MELEE_RANGE) { chargeTarget = null; Console.WriteLine("taking off charge target"); overrideDirection = null; } } //update cds? enemyCooldowns[(int)cooldowns.melee].setCDReduc(buffs.getValue(BuffType.physicalHaste)); }
internal bool startCharge() { //choose random raid unit do{ chargeTarget = InGame.getInstance().getRandomAlivePlayer(); }while(chargeTarget == aggro); hungered = null; charging = true; //gain charge buff model.setRing(Color.Green); InGame.getInstance().addScreenNote("CHARGE AT "+chargeTarget.getName()); InGame.getInstance().setWarningFG(chargedwarningTexture); runspeed = DEFAULT_RUNSPEED / 4; Console.WriteLine("startCharge"); return true; }
internal override void Update(double gameTime) { base.Update(gameTime); aggro = getFirstThreat(); if (currentHp <= 0) { myBossFight.initPhase(3);//EFF make it so it doesnt spam this?buts ok i guess wipeAllThreat(); return; } else if (dState == dogState.p1 && getHPpercent() <= PHASE_2_TRANSITION_PERCENT) { dState = dogState.p2; myBossFight.initPhase(2); } if (aggro == null) {//if no one has aggro put cooldowns on CD (start of fight) //enemyCooldowns[(int)cooldowns.spawnAdds].use(gameTime); return; } //try biting if (dState == dogState.biting) { if (checkRangeAndMove(biteTarget.getMid(), BITE_RANGE, gameTime)) {//get close } else {// then bite //InGame.getInstance().addProjectile(new Projectile(this, getMid(), biteTarget, doMelee, meleeProjectileTexture, meleeProjectileRect)); if (InGame.isInRange(getMid(), biteTarget.getMid(), BITE_RANGE)) {//idk how it gets to this if it is still runnning Buff b = new Buff(gameTime, BuffType.physicalDOT, BITE_TOTAL_TIME, doBiteDmg, BITE_TICK_TIME); b.addAvatarTexture(biteTexture); biteTarget.addBuff(b); dState = dogState.p2; } } } //melee else if (!isMoving() && enemyCooldowns[0].use(gameTime)) { if (checkRangeAndMove(aggro.getMid(), MELEE_RANGE, gameTime)) {//get close } else InGame.getInstance().addProjectile(new Projectile(this, getMid(), aggro, doMelee, meleeProjectileTexture, meleeProjectileRect)); } }
internal void remove(Buff buff) { buffs.Remove(buff); }
internal void addBuff(Buff b) { b.parent = this; buffs.Add(b); }