Search in sources :

Example 1 with FieldObject

use of server.maps.FieldObject in project HeavenMS by ronancpl.

the class MCBattlefield method updateMonsterBuffs.

private void updateMonsterBuffs() {
    List<MCGuardian> redGuardians = new ArrayList<>();
    List<MCGuardian> blueGuardians = new ArrayList<>();
    for (MCGuardian g : this.redReactors.values()) {
        redGuardians.add(g);
        if (MonsterCarnival.DEBUG) {
            System.out.println("update buff red " + g.getMobSkillID());
        }
    }
    for (MCGuardian g : this.blueReactors.values()) {
        blueGuardians.add(g);
        if (MonsterCarnival.DEBUG) {
            System.out.println("update buff blue " + g.getMobSkillID());
        }
    }
    for (FieldObject mmo : map.getAllMonsters()) {
        if (mmo.getType() == FieldObjectType.MONSTER) {
            MapleMonster mob = ((MapleMonster) mmo);
            mob.dispel();
            if (mob.getTeam() == MCField.MCTeam.RED.code) {
                applyGuardians(mob, redGuardians);
            } else if (mob.getTeam() == MCField.MCTeam.BLUE.code) {
                applyGuardians(mob, blueGuardians);
            } else {
                MCTracker.log("[MCPQ] Attempting to give guardians to mob without team.");
            }
        }
    }
}
Also used : FieldObject(server.maps.FieldObject) ArrayList(java.util.ArrayList) MapleMonster(server.life.MapleMonster)

Aggregations

ArrayList (java.util.ArrayList)1 MapleMonster (server.life.MapleMonster)1 FieldObject (server.maps.FieldObject)1