use of main.game.logic.event.Event in project Eidolons by IDemiurge.
the class SpellExecutor method resolve.
@Override
public void resolve() {
if (!getRef().isQuiet()) {
result = new Event(STANDARD_EVENT_TYPE.SPELL_BEING_RESOLVED, getRef()).fire();
if (!result) {
return;
}
}
if (isInterrupted()) {
return;
// return true; // TODO group effects blocked?!
}
applySpellpowerMod();
DC_SoundMaster.playEffectSound(SOUNDS.RESOLVE, getSpell());
super.resolve();
if (result) {
applyImpactSpecialEffect();
}
if (!getRef().isQuiet()) {
new Event(STANDARD_EVENT_TYPE.SPELL_RESOLVED, getRef()).fire();
}
if (!result) {
if (channeling) {
DC_SoundMaster.playEffectSound(SOUNDS.FAIL, getSpell());
} else // try fail sound?
{
DC_SoundMaster.playStandardSound(STD_SOUNDS.SPELL_RESISTED);
}
}
}
use of main.game.logic.event.Event in project Eidolons by IDemiurge.
the class DoorMaster method open.
@Override
public void open(DungeonObj obj, Ref ref) {
Door door = (Door) obj;
door.setState(DOOR_STATE.OPEN);
// GuiEventManager.trigger(GuiEventType.OPEN_DOOR);
obj.getGame().fireEvent(new Event(STANDARD_EVENT_TYPE.DOOR_OPENS, ref));
}
use of main.game.logic.event.Event in project Eidolons by IDemiurge.
the class OwnershipChangeEffect method applyThis.
@Override
public boolean applyThis() {
if (!new Event(STANDARD_EVENT_TYPE.UNIT_OWNERSHIP_CHANGED, ref).fire()) {
return false;
}
// + trigger rule flip image when ownership changes ;)
Obj obj = ref.getTargetObj();
Player newOwner = obj.getOriginalOwner();
if (!neutral) {
newOwner = // ref.getSourceObj().getOwner();
((MicroGame) ref.getGame()).getPlayer(!obj.getOwner().isMe());
}
obj.setOwner(newOwner);
if (permanent) {
obj.setOriginalOwner(newOwner);
// obj.addProperty(G_PROPS.STATUS, STATUS.CHARMED.name());
}
if (berserker) {
}
LogMaster.log(LogMaster.CORE_DEBUG_1, ref.getTargetObj().getName() + "'s new owner: " + obj.getOwner());
return true;
}
use of main.game.logic.event.Event in project Eidolons by IDemiurge.
the class PassiveAbilityObj method kill.
// @Override
// public boolean activate() {
// boolean result = true;
//
//
// return result;
// }
@Override
public boolean kill() {
Ref REF = Ref.getCopy(ref);
if (isDead()) {
return false;
}
if (!game.fireEvent(new Event(STANDARD_EVENT_TYPE.PASSIVE_BEING_REMOVED, REF))) {
return false;
}
setDead(true);
game.getManager().attachmentRemoved(this, ownerObj);
game.fireEvent(new Event(STANDARD_EVENT_TYPE.PASSIVE_REMOVED, REF));
applied = false;
return super.kill();
}
use of main.game.logic.event.Event in project Eidolons by IDemiurge.
the class DeathMaster method unitAnnihilated.
public void unitAnnihilated(Obj _killed, Obj _killer) {
String message = null;
if (_killed == _killer) {
// + _killed.getInfoString();
message = _killed + " annihilates ";
} else
message = _killed + " annihilated by " + _killer;
SpecialLogger.getInstance().appendSpecialLog(SPECIAL_LOG.MAIN, message);
getGame().getGraveyardManager().removeCorpse(_killed);
_killed.setAnnihilated(true);
getGame().fireEvent(new Event(STANDARD_EVENT_TYPE.UNIT_HAS_BEEN_ANNIHILATED, new Context(_killer, _killed)));
// TODO getGame().getDroppedItemManager().remove((DC_HeroObj) _killed, item);
}
Aggregations