public Assassin(int level) : base(RandomeEvilName.RandomName(RandomeEvilName.AssasinNames), level) { this.forcePower = this.TotalEnergy / InitialEvilSettings.EnergyToForcePowerRatio; this.forceSuccess = Randomizer.Rand.Next(InitialEvilSettings.ForceSuccessMin, InitialEvilSettings.ForceSuccessMax + 1); this.forceAttack = new Skill(PowerEnum.ForcePower, InitialEvilSettings.ForceAttackName, this.forcePower, this.forceSuccess); }
public bool AskForCardUsage(Prompt prompt, ICardUsageVerifier verifier, out ISkill skill, out List<Card> cards, out List<Player> players) { line = "U JiJiang 1: 2 3"; Match m = Regex.Match(line, @"U\s(?<skill>[A-Za-z]*)(?<cards>(\s\d+)*):(?<players>(\s\d+)*)"); skill = null; cards = null; players = null; if (m.Success) { if (m.Groups["skill"].Success) { foreach (ISkill s in hostPlayer.Skills) { if (s is CardTransformSkill) { } if (s is ActiveSkill) { } } } return true; } else { return false; } }
private string GetSkillType(ISkill skill) { if(skill is Skill.ComboBonus) { return "コンボボーナス"; } if (skill is Skill.ComboContinuation) { return "コンボ継続"; } if (skill is Skill.DamageGuard) { return "ダメージガード"; } if (skill is Skill.JudgeEnhancement) { return "判定強化"; } if (skill is Skill.Revival) { return "ライフ回復"; } if (skill is Skill.ScoreBonus) { return "スコアボーナス"; } if (skill is Skill.Overload) { return "オーバーロード"; } return null; }
/// <summary> /// If the character is currently casting a skill, then attempts to cancel the skill. /// </summary> /// <returns>True if there was a skill being casted and it was successfully stopped; false if there was /// no skill being casted or the skill could not be canceled.</returns> public bool TryCancelCastingSkill() { if (!IsCastingSkill) return false; Debug.Assert(_currentCastingSkill != null); // Clear the casting status variables _currentCastingSkill = null; _castingSkillTarget = null; // Tell the caster that they stopped casting if (_character is INetworkSender) { using (var pw = ServerPacket.SkillStopCasting_ToUser()) { ((INetworkSender)_character).Send(pw, ServerMessageType.GUIUserStatus); } } // Tell everyone that the casting stopped using (var pw = ServerPacket.SkillStopCasting_ToMap(_character.MapEntityIndex)) { _character.Map.Send(pw, ServerMessageType.MapDynamicEntityProperty); } return true; }
public LuoYan() { var acquiredSkills = new AutoNotifyPassiveSkillTrigger( this, (p, e, a) => { return a.Cards.Any(c => c.Place.DeckType == XingWu.XingWuDeck) && lyLiuLi == null && lyTianXiang == null; }, (p, e, a) => { lyLiuLi = new LiuLi(); lyTianXiang = new TianXiang(); Game.CurrentGame.PlayerAcquireAdditionalSkill(p, lyLiuLi, HeroTag, true); Game.CurrentGame.PlayerAcquireAdditionalSkill(p, lyTianXiang, HeroTag, true); }, TriggerCondition.OwnerIsSource ); Triggers.Add(GameEvent.CardsAcquired, acquiredSkills); var loseSkills = new AutoNotifyPassiveSkillTrigger( this, (p, e, a) => { return a.Cards.Any(c => c.HistoryPlace1.DeckType == XingWu.XingWuDeck) && Game.CurrentGame.Decks[p, XingWu.XingWuDeck].Count == 0; }, (p, e, a) => { Game.CurrentGame.PlayerLoseAdditionalSkill(p, lyLiuLi, true); Game.CurrentGame.PlayerLoseAdditionalSkill(p, lyTianXiang, true); lyLiuLi = null; lyTianXiang = null; } , TriggerCondition.OwnerIsSource ); IsEnforced = true; Triggers.Add(GameEvent.CardsLost, loseSkills); }
private void OnSkillDeactivated(Combatant combatant, ISkill skill) { _gridField.ClearPoints(); _gridField.RebuildMesh(); _ranged = null; _directional = null; }
private void OnSkillActivated(Combatant combatant, ISkill skill) { // Unbind delegates from old skill if (_ranged != null) { _ranged.TargetChanged -= OnTargetChanged; } else if (_directional != null) { _directional.DirectionChanged -= OnDirectionChanged; } // Figure out origin from ActionQueue PawnAction lastAction = _combatant.LastAction; _origin = (lastAction == null) ? _combatant.Position : lastAction.PostRunPosition; // Figure out what kind of skill it is _ranged = skill as RangedSkill; _directional = skill as DirectionalSkill; // Bind delegates to new skill if (_ranged != null) { _ranged.TargetChanged += OnTargetChanged; OnTargetChanged(_ranged.Target); } else if (_directional != null) { _directional.DirectionChanged += OnDirectionChanged; OnDirectionChanged(_directional.Direction); } }
public HuaShen() { acquiredSkill = null; var trigger = new AutoNotifyPassiveSkillTrigger( this, (p, e, a) => { AcquireHeroCard(p, HeroTag); AcquireHeroCard(p, HeroTag); Run(p, e, a); }, TriggerCondition.OwnerIsSource ) { AskForConfirmation = false }; var trigger2 = new AutoNotifyPassiveSkillTrigger( this, (p, e, a) => { return Game.CurrentGame.Decks[Owner, HuaShenDeck].Count > 0; }, Run, TriggerCondition.OwnerIsSource ); Triggers.Add(GameEvent.PlayerGameStartAction, trigger); Triggers.Add(GameEvent.PhaseProceedEvents[TurnPhase.BeforeStart], trigger2); Triggers.Add(GameEvent.PhasePostEnd, trigger2); IsAutoInvoked = false; DeckCleanup.Add(HuaShenDeck); }
public override VerifierResult FastVerify(Player source, ISkill skill, List<Card> cards, List<Player> players) { if (skill != null || (cards != null && cards.Count != 0)) { return VerifierResult.Fail; } if (players == null || players.Count == 0) { return VerifierResult.Partial; } foreach (Player p in players) { if (p == source) { return VerifierResult.Fail; } if (Game.CurrentGame.Decks[p, DeckType.Hand].Count == 0) { return VerifierResult.Fail; } } if (players.Count > 2) { return VerifierResult.Fail; } return VerifierResult.Success; }
public GetJudgeCardTrigger(Player p, ISkill skill, ICard card, bool permenant = false) { Owner = p; jSkill = skill; jCard = card; doNotUnregister = permenant; }
public Bot(int level) : base(RandomeEvilName.RandomName(RandomeEvilName.RobotNames), level) { this.mentalPower = this.TotalEnergy / InitialEvilSettings.EnergyToMentalPowerRatio; this.mentalSuccess = Randomizer.Rand.Next(InitialEvilSettings.MentalSuccessMin, InitialEvilSettings.MentalSuccessMax + 1); this.mentalAttack = new Skill(PowerEnum.MentalPower, InitialEvilSettings.MentalAttackName, this.mentalPower, this.mentalSuccess); }
public void AddSkill(ISkill skill) { if (_skillList.Count < _skillCapacity) { _skillList.Add(skill); } }
public ISkill GetSkill(ISkill check) { if (check.IsUnlock()) { return(check); } return(null); }
public override bool IsReforging(Player source, ISkill skill, List<Card> cards, List<Player> targets) { if (targets == null || targets.Count == 0) { return true; } return false; }
public bool IsActivePrestigeSkill(SFarmer player, string skillName) { this._ValidateFarmer(player); this._ValidateSkill(skillName); ISkill skill = this.GetSkillInfo(skillName); return(this.SkillData[player.UniqueMultiplayerID].Skills[skillName].Level <= skill.MaxSkillLevel); }
public int GetSkillLevel(SFarmer player, string skillName) { this._ValidateFarmer(player); this._ValidateSkill(skillName); ISkill skill = this.GetSkillInfo(skillName); return(Math.Min(skill.MaxSkillLevel, this.SkillData[player.UniqueMultiplayerID].Skills[skillName].Level)); }
public bool ReEffect(ISkill srcSkill, ISkillPlayer caster) { if (this._undoFlag == 0 && !this._redoFlag) { return(false); } return(EffectCore(srcSkill, caster, this._undoFlag, true)); }
public override VerifierResult FastVerify(Player source, ISkill skill, List <Card> cards, List <Player> players) { if (cards != null && cards.Count > 0) { return(VerifierResult.Fail); } return(verifier.FastVerify(source, skill, new List <Card>(), players)); }
public bool Trigger(ISkill srcSkill, ISkillPlayer caster) { if (null == caster) { return(false); } return(CheckValue(caster.SkillColour)); }
public void SetGameData(List <IGameObject> map, int score, int lvl, ISkill skill, Player player) { Map = map.Where(e => !(e is Spawner)).Select(e => e.ToString()).ToList(); Score = score; Lvl = lvl; Skill = skill?.ToString(); Player = player; }
protected override bool IsCorrectJudgeAction(ISkill skill, ICard card) { if (askDel()) { return true; } return false; }
public bool Trigger(ISkill srcSkill, ISkillPlayer caster) { if (null == caster) { return(false); } return(CheckCore(caster)); }
public bool Trigger(ISkill srcSkill, ISkillPlayer caster) { if (null == caster) { return(false); } return(CheckValue(caster.GetStatInt((int)StatType))); }
public Ability(ISkill skill, int level, Dictionary <string, string> description) { Skill = skill; Level = level; Description = description; hashCode = $"{Localization.GetDefault(Skill.Name)}|{Level}".GetHashCode(); }
public virtual bool EffectSkills(ISkill srcSkill, ISkillPlayer caster, IList <ISkill> dstSkills) { foreach (var target in dstSkills) { target.AddEffect(this); } return(true); }
protected virtual bool RevokeBoost(ISkill srcSkill, ISkillPlayer caster, List <T> targets) { foreach (var target in targets) { target.ForceSyncBoost(true); } return(true); }
private void PopulateSkillList() { for (int i = 0; i < skillRepository.GetSize(); i++) { ISkill current = skillRepository.GetAt(i); careerTabView.AddSkillToSelection(current); } }
public int GetTotalExperience(SFarmer player, string skillName) { _ValidateFarmer(player); _ValidateSkill(skillName); ISkill skill = GetSkillInfo(skillName); return(this._SkillData[player.uniqueMultiplayerID].Skills[skillName].Experience); }
public int GetPrestigeLevel(SFarmer player, string skillName) { _ValidateFarmer(player); _ValidateSkill(skillName); ISkill skill = GetSkillInfo(skillName); return(Math.Max(0, this._SkillData[player.uniqueMultiplayerID].Skills[skillName].Level - skill.MaxSkillLevel)); }
public override bool IsReforging(Player source, ISkill skill, List <Card> cards, List <Player> targets) { if (targets == null || targets.Count == 0) { return(true); } return(false); }
public void Action(ISkill skill, SkillActionData data, CommonParam param) { if (SkillUtil.GetSkillActionHeal(skill.GetSkillLevel(), data, out int heal)) { Heal(skill, param, heal); } skill.RemoveSkillAction(data.Id, param); }
public bool AskForCardUsage(Prompt prompt, ICardUsageVerifier verifier, out ISkill skill, out List<Card> cards, out List<Player> players, out Player respondingPlayer) { cards = null; skill = null; players = null; respondingPlayer = null; return false; }
public void Action(ISkill skill, SkillActionData data, CommonParam param) { if (SkillUtil.GetSkillActionDamage(skill.GetSkillLevel(), data, out int damage)) { Damage(skill, param, damage); } skill.RemoveSkillAction(data.Id, param); }
public bool AskForCardUsage(Prompt prompt, ICardUsageVerifier verifier, out ISkill skill, out List <Card> cards, out List <Player> players, out Player respondingPlayer) { this.prompt = prompt; this.verifier = verifier; foreach (var inactiveProxy in inactiveProxies) { if (inactiveProxy.HostPlayer != null && !inactiveProxy.HostPlayer.IsDead) { inactiveProxy.TryAskForCardUsage(prompt, new NullVerifier()); } } pendingUiThread = new Thread(AskUiThread) { IsBackground = true }; pendingUiThread.Start(); proxy.SimulateReplayDelay(); if (!proxy.TryAnswerForCardUsage(prompt, verifier, out skill, out cards, out players)) { cards = new List <Card>(); players = new List <Player>(); skill = null; } pendingUiThread.Abort(); pendingUiThread = null; foreach (var otherProxy in inactiveProxies) { otherProxy.Freeze(); } proxy.Freeze(); proxy.NextQuestion(); // try to determine who used this respondingPlayer = null; if (cards != null && cards.Count > 0) { respondingPlayer = cards[0].Place.Player; } else { foreach (var p in Game.CurrentGame.Players) { if (p.ActionableSkills.Contains(skill)) { respondingPlayer = p; break; } } } if (skill != null || (cards != null && cards.Count > 0)) { Trace.Assert(respondingPlayer != null); } if (verifier.Verify(respondingPlayer, skill, cards, players) == VerifierResult.Success) { return(true); } return(false); }
public bool Add(ISkill skill) { if (NotAlreadyIn(skill)) { skills.Add(skill); return true; } return false; }
protected override bool IsCorrectJudgeAction(ISkill skill, ICard card) { if (askDel()) { this.skill.NotifySkillUse(); return true; } return false; }
private void UpdateSubjects(ISkill skill) { this.skillTabView.SubjectsClear(); ISubjectRepository subjectRepository = skill.Subjects; for (int i = 0; i < subjectRepository.GetSize();i++) { this.skillTabView.AddSkillSubject(subjectRepository.GetAt(i)); } }
private Worker(int id, ISkill skill, IShift shift) : this() { if (id == -1) { id = this.NextId(); } ID = id; Skill = skill; Shift = shift; }
public bool AskForCardUsage(Prompt prompt, ICardUsageVerifier verifier, out ISkill skill, out List<Card> cards, out List<Player> players, out Player respondingPlayer) { this.prompt = prompt; this.verifier = verifier; foreach (var inactiveProxy in inactiveProxies) { if (inactiveProxy.HostPlayer != null && !inactiveProxy.HostPlayer.IsDead) { inactiveProxy.TryAskForCardUsage(prompt, new NullVerifier()); } } pendingUiThread = new Thread(AskUiThread) { IsBackground = true }; pendingUiThread.Start(); proxy.SimulateReplayDelay(); if (!proxy.TryAnswerForCardUsage(prompt, verifier, out skill, out cards, out players)) { cards = new List<Card>(); players = new List<Player>(); skill = null; } pendingUiThread.Abort(); pendingUiThread = null; foreach (var otherProxy in inactiveProxies) { otherProxy.Freeze(); } proxy.Freeze(); proxy.NextQuestion(); // try to determine who used this respondingPlayer = null; if (cards != null && cards.Count > 0) { respondingPlayer = cards[0].Place.Player; } else { foreach (var p in Game.CurrentGame.Players) { if (p.ActionableSkills.Contains(skill)) { respondingPlayer = p; break; } } } if (skill != null || (cards != null && cards.Count > 0)) { Trace.Assert(respondingPlayer != null); } if (verifier.Verify(respondingPlayer, skill, cards, players) == VerifierResult.Success) { return true; } return false; }
// Use this for initialization void Start () { enemyStart (); fighter = (Fighter)GameObject.FindObjectOfType(typeof(Fighter)); aggroRange = 20; speed = 4; attackRange = 2; activeSkill1 = GetComponent<BasicMelee> (); activeSkill3 = GetComponent<BerserkMode> (); activeSkill4 = GetComponent<CycloneSkill> (); activeSkill2 = GetComponent<SpinAttack> (); }
public static void Add(IContext context, ISkill skill) { Context ctx = context as Context; if (ctx == null) throw new Exception(typeof(Context).FullName + " expected."); SqlCommand command = new SqlCommand("insert into Skill (title) values (@Title)"); command.Parameters.Add(new SqlParameter("Title", skill.Title)); command.ExecuteNonQuery(); }
public void AnswerItem(ISkill skill) { if (skill is CheatSkill) { sender.Send(skill); } else { sender.Send(Translator.Translate(skill)); } }
public override string Attack(ICharacter enemy, ISkill skill) { if (this.ManaPoints >= skill.ManaCost) { int damage = skill.Hit(enemy); this.ManaPoints -= skill.ManaCost; return string.Format("Enemy cast {0}\n and dealt {1} damage to you!", skill.Name, damage); } return string.Format("The {0} does not have enough mana to cast {1}", this.GetType().Name, skill.Name); }
public BipedSkillPalette(Actor owner) : base(owner) { Skills = new ISkill[EquipSlot.NUM_SKILL_SLOTS]; for (int s = 0; s < EquipSlot.NUM_SKILL_SLOTS; ++s) { Skills[s] = null; } mCharacterInfo = null; mContentLoader = null; }
public FuHun() { fhWuSheng = new WuSheng(); fhPaoXiao = new PaoXiao(); var trigger = new AutoNotifyPassiveSkillTrigger( this, Run, TriggerCondition.OwnerIsSource ) { IsAutoNotify = false }; Triggers.Add(GameEvent.PhaseBeginEvents[TurnPhase.Draw], trigger); IsAutoInvoked = null; }
public static void Update(IContext context, ISkill skill) { Context ctx = context as Context; if (ctx == null) throw new Exception(typeof(Context).FullName + " expected."); SqlCommand command = new SqlCommand("update Skill set title=@Title where id_skill = @SkillID"); command.Parameters.Add(new SqlParameter("SkillID", skill.SkillID)); command.Parameters.Add(new SqlParameter("Title", skill.Title)); command.ExecuteNonQuery(); }
public void AddSkill(UnitIdentity owner, string skillUniqueName, ISkill skill) { if(this.skillSetTable.ContainsKey(owner)) { this.skillSetTable[owner].Add(skillUniqueName, skill); } else { Dictionary<string, ISkill> unitSkillTable = new Dictionary<string, ISkill>(); unitSkillTable.Add(skillUniqueName, skill); this.skillSetTable.Add(owner, unitSkillTable); } }
private IWorker GetNextWorker(ISkill skill) { foreach (var workerState in _workerAvailableStates[skill]) { if (workerState.Value) { // return first worker that is available return _converter.WorkerTypes[skill][workerState.Key]; } } return null; }
public override string Attack(ICharacter enemy, ISkill skill) { if (this.ManaPoints >= skill.ManaCost) { int damage = skill.Hit(enemy); this.ManaPoints -= skill.ManaCost; return string.Format("You cast {0}{1} and dealt {2} damage to the enemy!", skill.Name, Environment.NewLine, damage); } return string.Format(Messages.NotEnoughManaError, skill.Name); }