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);
 }
예제 #2
0
파일: TestUiProxy.cs 프로젝트: pxoylngx/sgs
        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;
            }
        }
예제 #3
0
 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;
 }
예제 #4
0
        /// <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;
        }
예제 #5
0
        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);
        }
예제 #6
0
 private void OnSkillDeactivated(Combatant combatant, ISkill skill)
 {
     _gridField.ClearPoints();
     _gridField.RebuildMesh();
     _ranged = null;
     _directional = null;
 }
예제 #7
0
    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);
        }
    }
예제 #8
0
파일: HuaShen.cs 프로젝트: kingling/sgs
        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);
        }
예제 #9
0
파일: TuXi.cs 프로젝트: pxoylngx/sgs
 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;
 }
예제 #10
0
 public GetJudgeCardTrigger(Player p, ISkill skill, ICard card, bool permenant = false)
 {
     Owner = p;
     jSkill = skill;
     jCard = card;
     doNotUnregister = permenant;
 }
예제 #11
0
 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);
 }
예제 #12
0
 public void AddSkill(ISkill skill)
 {
     if (_skillList.Count < _skillCapacity)
     {
         _skillList.Add(skill);
     }
 }
예제 #13
0
 public ISkill GetSkill(ISkill check)
 {
     if (check.IsUnlock())
     {
         return(check);
     }
     return(null);
 }
예제 #14
0
 public override bool IsReforging(Player source, ISkill skill, List<Card> cards, List<Player> targets)
 {
     if (targets == null || targets.Count == 0)
     {
         return true;
     }
     return false;
 }
예제 #15
0
        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);
        }
예제 #16
0
        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));
        }
예제 #17
0
 public bool ReEffect(ISkill srcSkill, ISkillPlayer caster)
 {
     if (this._undoFlag == 0 && !this._redoFlag)
     {
         return(false);
     }
     return(EffectCore(srcSkill, caster, this._undoFlag, true));
 }
예제 #18
0
 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));
 }
예제 #19
0
 public bool Trigger(ISkill srcSkill, ISkillPlayer caster)
 {
     if (null == caster)
     {
         return(false);
     }
     return(CheckValue(caster.SkillColour));
 }
예제 #20
0
 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;
 }
예제 #21
0
파일: TianDu.cs 프로젝트: h1398123/sgs
 protected override bool IsCorrectJudgeAction(ISkill skill, ICard card)
 {
     if (askDel())
     {
         return true;
     }
     return false;
 }
예제 #22
0
 public bool Trigger(ISkill srcSkill, ISkillPlayer caster)
 {
     if (null == caster)
     {
         return(false);
     }
     return(CheckCore(caster));
 }
예제 #23
0
 public bool Trigger(ISkill srcSkill, ISkillPlayer caster)
 {
     if (null == caster)
     {
         return(false);
     }
     return(CheckValue(caster.GetStatInt((int)StatType)));
 }
예제 #24
0
        public Ability(ISkill skill, int level, Dictionary <string, string> description)
        {
            Skill       = skill;
            Level       = level;
            Description = description;

            hashCode = $"{Localization.GetDefault(Skill.Name)}|{Level}".GetHashCode();
        }
예제 #25
0
 public virtual bool EffectSkills(ISkill srcSkill, ISkillPlayer caster, IList <ISkill> dstSkills)
 {
     foreach (var target in dstSkills)
     {
         target.AddEffect(this);
     }
     return(true);
 }
예제 #26
0
 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);
     }
 }
예제 #28
0
        public int GetTotalExperience(SFarmer player, string skillName)
        {
            _ValidateFarmer(player);
            _ValidateSkill(skillName);
            ISkill skill = GetSkillInfo(skillName);

            return(this._SkillData[player.uniqueMultiplayerID].Skills[skillName].Experience);
        }
예제 #29
0
        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));
        }
예제 #30
0
 public override bool IsReforging(Player source, ISkill skill, List <Card> cards, List <Player> targets)
 {
     if (targets == null || targets.Count == 0)
     {
         return(true);
     }
     return(false);
 }
예제 #31
0
 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);
 }
예제 #32
0
 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;
 }
예제 #33
0
 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);
 }
예제 #34
0
 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);
 }
예제 #35
0
 public bool Add(ISkill skill)
 {
     if (NotAlreadyIn(skill))
     {
         skills.Add(skill);
         return true;
     }
     return false;
 }
예제 #36
0
 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));
           }
        }
예제 #38
0
 private Worker(int id, ISkill skill, IShift shift) : this()
 {
     if (id == -1)
     {
         id = this.NextId();
     }
     ID = id;
     Skill = skill;
     Shift = shift;
 }
예제 #39
0
 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;
 }
예제 #40
0
	// 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> ();
	}
예제 #41
0
        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();
        }
예제 #42
0
파일: Client.cs 프로젝트: maplegh/sgs
 public void AnswerItem(ISkill skill)
 {
     if (skill is CheatSkill)
     {
         sender.Send(skill);
     }
     else
     {
         sender.Send(Translator.Translate(skill));
     }
 }
예제 #43
0
        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);
        }
예제 #44
0
        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;
        }
예제 #45
0
파일: FuHun.cs 프로젝트: kingling/sgs
 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;
 }
예제 #46
0
        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);
        }
    }
예제 #48
0
 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;
 }
예제 #49
0
        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);
        }