public Tuple<bool, string> IsCharacterIllegal(Character c) { if (c.CharBase.TurnPoints.MaxVal > allowedTurnPoints) return new Tuple<bool, string>(true, "The character " + c.CharBase.Name + " was illegal. The maximum allowed amount of turn points is " + allowedTurnPoints.ToString() + " the character had " + c.CharBase.TurnPoints.ToString() + "."); else if (c.CharBase.Health.MaxVal > 100 * scale) return new Tuple<bool, string>(true, "The character " + c.CharBase.Name + " was illegal. The maximum allowed amount of health points is " + (100*scale).ToString() + " the character had " + c.CharBase.Health.MaxVal.ToString() + "."); return new Tuple<bool, string>(false, ""); }
public Tuple<bool, Ability> IsAbilityIlligal(Character c) { foreach (Ability a in c.CharBase.Abilities) { if (a.Cost > baseCost * scale) return new Tuple<bool, Ability>(true, a); } return new Tuple<bool,Ability>(false, null); }
public CharacterEditorViewModel(Character character) { Character = character; _originalCharacter = new Character() { Background = character.Background, FactionName = character.FactionName, FirstName = character.FirstName, Gender = character.Gender, LastName = character.LastName }; CharacterViewModel = new CharacterViewModel(Character); }
public bool Collision(Character attacker) { if (this is Enemy && attacker is Enemy) { return false; } int attack = attacker.damagePoints; if (attacker is Hero) { attack += (attacker as Hero).Weapon.Damage; } LoseHealthPoints(attack); return this.IsDead; }
public static ColoredString CharacterName(Character Char) { Color charColor; switch (Char.CharBase.Team) { case 1: charColor = Color.Red; break; case 2: charColor = Color.Blue; break; default: charColor = Color.Black; break; } return new ColoredString(charColor, Char.CharBase.Name); }
/// <summary> /// 武器牌所能造成的伤害 /// </summary> /// <returns></returns> public abstract float Damage(Character character);
public SkillBattleState(PositiveSkill skill, Character owner, int level = 1) { this.skill = skill; this.owner = owner; IsActive = true; cooldown = skill.Cooldown; this.level = level; }
/// <summary> /// 创建该技能的战斗状态,如果是被动技能则返回null /// </summary> /// <returns></returns> public virtual SkillBattleState CreateBattleState(Character owner, SkillData data) { return null; }
public override SkillBattleState CreateBattleState(Character owner, SkillData data) { var state = new SkillBattleState(this, owner, data.Level); return state; }
/// <summary> /// Uses an ability. /// </summary> /// <param name="Source">The Character who uses the ability.</param> /// <param name="Target">The Character that is the target of the ability.</param> public void Use(Character Source, List<Character> Targets) { OnAbilityFired(this, new AbilityEventArgs(Source, Targets, this)); }
private void GetSelf() { //Get me if (listOfCharacters.Where(x => x.CharAI.Equals(this)).FirstOrDefault() != null) { Self = listOfCharacters.Where(x => x.CharAI.Equals(this)).FirstOrDefault(); } else { throw new Exception("Something went very wrong. I dont exist :("); } }
public void AddNewCharacter() { var character = _ssproj.AddNewCharacter(); NotifyOfPropertyChange(() => Characters); SelectedCharacter = character; }
public virtual bool Attack(Character target) { return target.Collision(this); }
public void Cancel() { FactionName = null; SelectedCharacter = null; }
public AbilityEventArgs(Character source, List<Character> targets, Ability ability) { this.Source = source; this.Targets = targets; this.Ability = ability; }
/// <summary> /// 卡片装备需求 /// </summary> /// <param name="character">装备者</param> /// <returns></returns> public virtual bool MeetRequirement(Character character) { return true; }
/// <summary> /// 构造函数,初始化参数 /// </summary> /// <param name="character"></param> public BattleState(Character character) { this.character = character; deck = new List<int>(character.Deck); }
public CharacterViewModel(Character character) { _character = character; }
public override bool Attack(Character target) { bool attackResult = base.Attack(target); if (attackResult) { this.Experience += 10; } return attackResult; }
protected CharacterViewModel() { _character = new Character(); }
//1 private void GetEnemies() { listOfCharacters.Sort((Character char1, Character char2) => char1.CharBase.Health.Current.CompareTo(char2.CharBase.Health.Current)); //Implementation of the loop structure in our own language if (FocusTarget == null) { FocusTarget = listOfCharacters.Where(x => x.CharBase.Team != Self.CharBase.Team).FirstOrDefault(); } if(SecondaryTarget == null) { SecondaryTarget = listOfCharacters.Where(x => x.CharBase.Team != Self.CharBase.Team && x != FocusTarget).FirstOrDefault(); if (SecondaryTarget == null) SecondaryTarget = FocusTarget; } }
/// <summary> /// 获得技能的战斗状态 /// </summary> /// <param name="character">技能所有者</param> /// <param name="data">技能数据</param> /// <returns></returns> public static SkillBattleState CreateSkillBattleStateByData(Character character, SkillData data) { var skill = GetSkillById(data.Id); return skill.CreateBattleState(character, data); }