public bool Evaluate(ActionHandler2 firer, bool transact) { if (condition.Evaluate(firer, transact)) { return statement.Evaluate(firer, transact); } return false; }
public bool Evaluate(ActionHandler2 firer, bool transact) { if (transact) { firer.CreateProjectile(objectCode, action, Vector2.zero); } return true; }
public bool Fire(ActionHandler2 firer) { if (action.Evaluate(firer, true)) { remainCooltime = commandEntity.coolTime; return true; } return false; }
public bool Evaluate(ActionHandler2 firer, bool transact) { bool ret = false; foreach (var entity in statements) { ret |= entity.Evaluate(firer, transact); } return ret; }
public bool Evaluate(ActionHandler2 firer, bool transact) { if (condition.Evaluate(firer, transact)) { return statement1.Evaluate(firer, transact); } else { return statement2.Evaluate(firer, transact); } }
public bool IsFirable(ActionHandler2 firer) { if (commandEntity.queuePriority > 0 && firer.IsInMotion()) { return false; } if (remainCooltime > 0) { return false; } return action.Evaluate(firer, false); }
protected override bool Fire(ActionHandler2 firer, Command2 command) { if (base.Fire(firer, command)) { if (consumable) { Remove(command); } return true; } return false; }
protected override bool Fire(ActionHandler2 firer, Command2 command) { if (base.Fire(firer, command)) { if (onChargedAttack != null) { /* if (command is BlockCommand) { BlockCommand blockCommand = command as BlockCommand; if (blockCommand.isChargedAttack) { onChargedAttack(blockCommand.matchGeneration); } } * */ } return true; } return false; }
public bool Evaluate(ActionHandler2 firer, bool transact) { var targets = firer.FindTarget(targetRange, targetType); if (targets.IsNullOrEmpty()) { return false; } var targetStatuses = targets.Select(x => x.Status).Where(x => x.ContainsKey(statusKey)); if (targetStatuses.IsNullOrEmpty()) { return false; } var expr = ReplaceRandomValue(valueExpr); float result = StatCalc.Calc(expr, firer.Stat); targetStatuses.ForEach(x => x.Change(statusKey, result)); // handle options return true; }
Command2 PickAction(ActionHandler2 firer) { foreach (var entity in queue) { if (pipe != null || entity.IsFirable(firer)) { Command2 ret = entity; return ret; } } return null; }
/* public void Fire(int index) { if (0 <= index && index < queue.Count) { Fire(queue[index]); } } */ protected virtual bool Fire(ActionHandler2 firer, Command2 command) { if (command != null) { if (command.IsFirable(firer)) { if (pipe != null) { pipe.TryAdd(command); return true; } /* if (command is OnDemandCommand && !(command as OnDemandCommand).HasFirableTarget(owner)) { return true; } */ return command.Fire(firer); } } return false; }
public void Fire(ActionHandler2 firer) { Command2 command = PickAction(firer); if (command != null) { Fire(firer, command); } }
protected override bool Fire(ActionHandler2 firer, Command2 command) { if (base.Fire(firer, command)) { /* if (command is ItemCommand) { (command as ItemCommand).PlaySound(owner); } * */ return true; } return false; }
public bool Evaluate(ActionHandler2 firer, bool transact) { return action.Evaluate(firer, transact); }