public override Value DoReduce(Slot[] me, Slot[] opponent, Value[] args, ref int applicationsDone, bool zombieMode) { var slot = args.First().AsSlot(); var vitality = me[slot].vitality; if (!zombieMode) { if (vitality > 0 && vitality < 65535) me[slot].vitality = vitality + 1; } else { if (vitality > 0) me[slot].vitality = vitality - 1; } return Funcs.I; }
public override Value DoReduce(Slot[] me, Slot[] opponent, Value[] args, ref int applicationsDone, bool zombieMode) { var arg = args.First(); if (arg is Num) return new Num(Math.Min(((Num)arg).num + 1, 65535)); throw new GameError("Call succ with not a num: " + arg); }
public override Value DoReduce(Slot[] me, Slot[] opponent, Value[] args, ref int applicationsDone, bool zombieMode) { return args.First(); }