public virtual ITargetSelfResult MockCopy(IAgent self) { ITargetSelfResult ret; var selfAgentInfo = this.Agents[self]; var okSelfAgentUpdateInfo = (AgentUpdateInfo)selfAgentInfo; var selfPlayer = selfAgentInfo.Owner; var okSelfPlayer = (Player)selfPlayer; var selfDeck = this.Players[selfPlayer]; this.WaitToNextTick(self); var copiesCount = (from a in selfDeck.GetInitialisedAgents<IAgent>() where a.Effects.Contains(AgentEffect.Copy) select a).Count() / 2; if (copiesCount < okSelfPlayer.Level) { var objCopiedAgent = Activator.CreateInstance(selfPlayer.GetType()); var copiedAgent = (IAgent)objCopiedAgent; var copiedAgentInfo = this.AddAgent(copiedAgent, selfAgentInfo.Level, selfPlayer); var okCopiedAgentInfo = (AgentUpdateInfo)copiedAgentInfo; okCopiedAgentInfo.Action = selfAgentInfo.Action; okCopiedAgentInfo.Clan = selfAgentInfo.Clan; okCopiedAgentInfo.EffectsList.Add(AgentEffect.Copy); okCopiedAgentInfo.Group = selfAgentInfo.Group; okCopiedAgentInfo.Heap = 0; okCopiedAgentInfo.Id = Guid.NewGuid(); okCopiedAgentInfo.Node = selfAgentInfo.Node; okCopiedAgentInfo.Stack = 1; okSelfAgentUpdateInfo.EffectsList.Add(AgentEffect.Copy); this.LaunchAgent(copiedAgent); ret = new TargetSelfResult { Result = SelfResultType.Success, Cooldown = 1, LastsFor = 1, Warmup = 1, Message = "Success mock copy." }; } else { ret = new TargetSelfResult { Result = SelfResultType.FailedInvalid, Cooldown = 1, LastsFor = 1, Warmup = 1, Message = "Failed (too-much-copies) mock copy." }; } this.Trace(self, TraceType.Information , "MOCK-Claim!" , "Self={", self, "}" , "Result={", ret, "}"); return ret; }
public virtual ITargetSelfResult MockWait(IAgent self) { this.WaitToNextTick(self); var ret = new TargetSelfResult { Result = SelfResultType.Success, Cooldown = 1, LastsFor = 1, Warmup = 1, Message = "Success mock wait." }; this.Trace(self, TraceType.Information , "MOCK-Claim!" , "Self={", self, "}" , "Result={", ret, "}"); return ret; }