예제 #1
0
        /// <summary>
        /// Assigns mana restoration spells from a Mage's spell inventory.
        /// </summary>
        /// <param name="self">The game client data for the Mage.</param>
        protected CasterManaCommands(MageClient self)
        {
            Self = self;

            InvokeSpell  = self.Spells.KeySpells.Invoke;
            InvokeStatus = self.Status.Invoke;
        }
예제 #2
0
 /// <summary>
 /// Initializes a Mage's status data.
 /// </summary>
 /// <param name="activity">The activity data of the Mage.</param>
 public MageStatus(TkActivity activity) : base(activity)
 {
     Doze     = new BuffStatus(activity, Mage.Doze);
     Hellfire = new BuffStatus(activity, Mage.Hellfire);
     Inferno  = new BuffStatus(activity, Mage.Inferno);
     Sleep    = new BuffStatus(activity, Mage.Sleep);
 }
예제 #3
0
 /// <summary>
 /// Assigns attack spells from the Warrior's spell inventory.
 /// </summary>
 /// <param name="self">The game client data for the Warrior.</param>
 public WarriorAttackCommands(WarriorClient self) : base(self)
 {
     _berserkSpell    = self.Spells.KeySpells.Berserk;
     _berserkStatus   = self.Status.Berserk;
     _whirlwindSpell  = self.Spells.KeySpells.Whirlwind;
     _whirlwindStatus = self.Status.Whirlwind;
 }
예제 #4
0
        /// <summary>
        /// Initializes tracking of Harden Armor, Sanctuary, and Valor buffs.
        /// </summary>
        /// <param name="activity">The player's activity data.</param>
        public AsvActivity(TkActivity activity)
        {
            var hardenArmorBuffs = new List <BuffKeySpell>();

            hardenArmorBuffs.AddRange(Caster.HardenArmor);
            hardenArmorBuffs.AddRange(Poet.Asv);
            hardenArmorBuffs.AddRange(Poet.AsvGroup);

            var sanctuaryBuffs = new List <BuffKeySpell>();

            sanctuaryBuffs.AddRange(Caster.Sanctuary);
            sanctuaryBuffs.AddRange(Poet.Asv);
            sanctuaryBuffs.AddRange(Poet.AsvGroup);

            var valorBuffs = new List <BuffKeySpell>();

            valorBuffs.AddRange(Caster.Valor);
            valorBuffs.AddRange(Rogue.Might);
            valorBuffs.AddRange(Poet.Asv);
            valorBuffs.AddRange(Poet.AsvGroup);

            HardenArmor = new BuffStatus(activity, hardenArmorBuffs);
            Sanctuary   = new BuffStatus(activity, sanctuaryBuffs);
            Valor       = new BuffStatus(activity, valorBuffs);
        }
예제 #5
0
 /// <summary>
 /// Assigns attack spells from the Rogue's spell inventory.
 /// </summary>
 /// <param name="self">The game client data for the Rogue.</param>
 public RogueAttackCommands(RogueClient self) : base(self)
 {
     _ambushSpell           = self.Spells.KeySpells.Ambush;
     _desperateAttackSpell  = self.Spells.KeySpells.DesperateAttack;
     _desperateAttackStatus = self.Status.DesperateAttack;
     _lethalStrikeSpell     = self.Spells.KeySpells.LethalStrike;
     _lethalStrikeStatus    = self.Status.LethalStrike;
 }
예제 #6
0
        /// <summary>
        /// Assigns spells from the Warrior's spell inventory.
        /// </summary>
        /// <param name="self">The game client data for the Warrior.</param>
        public WarriorCommands(WarriorClient self) : base(self)
        {
            _spotTrapsSpell  = self.Spells.KeySpells.SpotTraps;
            _spotTrapsStatus = self.Status.SpotTraps;

            Attacks = new WarriorAttackCommands(self);
            Buffs   = new WarriorBuffCommands(self);
            Heal    = new PeasantHealCommands(self);
        }
예제 #7
0
 /// <summary>
 /// Initializes a Rogue's status data.
 /// </summary>
 /// <param name="self">All game client data for the Rogue.</param>
 public RogueStatus(TkClient self) : base(self.Activity)
 {
     DesperateAttack = new BuffStatus(Activity, Rogue.DesperateAttack);
     Invisible       = new InvisibleStatus(Activity, Rogue.Invisible);
     LethalStrike    = new BuffStatus(Activity, Rogue.LethalStrike);
     Fury            = new BuffStatus(Activity, Rogue.Fury);
     Rage            = new RageStatus(self, Rogue.Cunning);
     ShadowFigure    = new BuffStatus(Activity, Rogue.ShadowFigure);
 }
예제 #8
0
        /// <summary>
        /// Assigns attack spells from the Mage's spell inventory.
        /// </summary>
        /// <param name="self">The game client data for the Mage.</param>
        public MageAttackCommands(MageClient self) : base(self)
        {
            _self = self;

            _hellfireSpell  = self.Spells.KeySpells.Hellfire;
            _hellfireStatus = self.Status.Hellfire;
            _infernoSpell   = self.Spells.KeySpells.Inferno;
            _infernoStatus  = self.Status.Inferno;
        }
예제 #9
0
 /// <summary>
 /// Assigns buff spells from the Rogue's spell inventory.
 /// </summary>
 /// <param name="self">The game client data for the Rogue.</param>
 public RogueBuffCommands(RogueClient self) : base(self)
 {
     _invisibleSpell     = self.Spells.KeySpells.Invisible;
     _invisibleStatus    = self.Status.Invisible;
     _mightSpell         = self.Spells.KeySpells.Might;
     _mightStatus        = self.Status.Might;
     _shadowFigureSpell  = self.Spells.KeySpells.ShadowFigure;
     _shadowFigureStatus = self.Status.ShadowFigure;
 }
예제 #10
0
        private IEnumerator RemainedBuffed(float buffDuration)
        {
            while (true)
            {
                yield return(new WaitForSeconds(buffDuration));

                _buffStatus = BuffStatus.Neutral;
                StopCoroutine(_coroutine);
            }
        }
예제 #11
0
        public static async Task <bool> CastStatus(TkClient caster, TkClient target, BuffStatus status, KeySpell statusEffectSpell)
        {
            if (status.IsActive || !await CastStatus(caster, target.Self.Uid, target.Self.Name, statusEffectSpell))
            {
                return(false);
            }

            status.ResetStatusCooldown();
            return(true);
        }
예제 #12
0
        /// <summary>
        /// Assigns buff spells from the Warrior's spell inventory.
        /// </summary>
        /// <param name="self">The game client data for the Warrior.</param>
        protected FighterBuffCommands(WarriorClient self)
        {
            Self        = self;
            _rageSpell  = self.Spells.KeySpells.Rage;
            _rageStatus = self.Status.Rage;

            _enchantSpell = self.Spells.KeySpells.Enchant;
            _furySpell    = self.Spells.KeySpells.Fury;
            _furyStatus   = self.Status.Fury;
        }
예제 #13
0
        /// <summary>
        /// Assigns spells from the Poet's spell inventory.
        /// </summary>
        /// <param name="self">The game client data for the Poet.</param>
        public PoetCommands(PoetClient self) : base(self)
        {
            _hardenBodySpell  = self.Spells.KeySpells.HardenBody;
            _hardenBodyStatus = self.Status.HardenBody;

            Attacks = new PoetAttackCommands(self);
            Debuffs = new PoetDebuffCommands(self);
            Heal    = new PoetHealCommands(self);
            Mana    = new PoetManaCommands(self);
        }
예제 #14
0
 /// <summary>
 /// Assigns buff spells from the Warrior's spell inventory.
 /// </summary>
 /// <param name="self">The game client data for the Warrior.</param>
 public WarriorBuffCommands(WarriorClient self) : base(self)
 {
     _backstabSpell  = self.Spells.KeySpells.Backstab;
     _backstabStatus = self.Status.Backstab;
     _blessingSpell  = self.Spells.KeySpells.Blessing;
     _blessingStatus = self.Status.Blessing;
     _flankSpell     = self.Spells.KeySpells.Flank;
     _flankStatus    = self.Status.Flank;
     _potenceSpell   = self.Spells.KeySpells.Potence;
     _potenceStatus  = self.Status.Potence;
 }
예제 #15
0
 /// <summary>
 /// Initializes a Warrior's status data.
 /// </summary>
 /// <param name="self">All game client data for the Warrior.</param>
 public WarriorStatus(TkClient self) : base(self.Activity)
 {
     Backstab  = new BuffStatus(Activity, Warrior.Backstab);
     Berserk   = new BuffStatus(Activity, Warrior.Berserk);
     Blessing  = new BuffStatus(Activity, Warrior.Blessing);
     Flank     = new BuffStatus(Activity, Warrior.Flank);
     Fury      = new BuffStatus(Activity, Warrior.Fury);
     Potence   = new BuffStatus(Activity, Warrior.Potence);
     Rage      = new RageStatus(self, Warrior.Rage);
     SpotTraps = new BuffStatus(Activity, Warrior.SpotTraps);
     Whirlwind = new BuffStatus(Activity, Warrior.Whirlwind);
 }
예제 #16
0
        /// <summary>
        /// Assigns mana restoration spells from a Poet's spell inventory.
        /// </summary>
        /// <param name="self">The game client data for the Poet.</param>
        protected CasterManaCommands(PoetClient self)
        {
            Self = self;

            InvokeSpell  = self.Spells.KeySpells.Invoke;
            InvokeStatus = self.Status.Invoke;

            if (InvokeSpell == null)
            {
                Log.Warning($"{self.Self.Name} does not have an Invoke spell. Mana restoration item consumption will be very high.");
            }
        }
예제 #17
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag == "obstacle")
        {
            Vector2 attackedVelocity = Vector2.zero;
            if (other.gameObject.transform.position.x > transform.position.x)
            {
                attackedVelocity = new Vector2(-2f, 7f);
            }
            else
            {
                attackedVelocity = new Vector2(2f, 7f);
            }

            health--;
        }

        if (other.gameObject.tag == "Coin")
        {
            BuffStatus coin = other.gameObject.GetComponent <BuffStatus>();
            movePower += coin.value;

            Destroy(other.gameObject, 0f);
        }

        if (other.gameObject.tag == "Bag")
        {
            health++;

            Destroy(other.gameObject, 0f);
        }

        if (other.gameObject.tag == "MainCamera")
        {
            Vector2 attackedVelocity = Vector2.zero;
            if (other.gameObject.transform.position.x > transform.position.x)
            {
                attackedVelocity = new Vector2(-20f, 20f);
            }
            else
            {
                attackedVelocity = new Vector2(20f, 20f);
            }

            health--;
        }

        if (other.gameObject.tag == "Bottom")
        {
            Destroy(gameObject, 0f);
        }
    }
예제 #18
0
        /// <summary>
        /// Assigns mana restoration spells from a Mage's spell inventory.
        /// </summary>
        /// <param name="self">The game client data for the Mage.</param>
        public MageManaCommands(MageClient self) : base(self)
        {
            if (Self.Inventory.KeyItems.InvokeOrb != null)
            {
                _mageInvokeOrb    = new KeySpell(Self.Inventory.KeyItems.InvokeOrb);
                _mageInvokeStatus = self.Status.MageInvoke;
            }

            if (InvokeSpell == null && _mageInvokeOrb == null)
            {
                Log.Warning($"{self.Self.Name} does not have an Invoke spell. Mana restoration item consumption will be very high.");
            }
        }
예제 #19
0
        /// <summary>
        /// Initializes a Rogue's status data.
        /// </summary>
        /// <param name="self">All game client data for the Rogue.</param>
        public RogueStatus(TkClient self) : base(self.Activity)
        {
            var mightBuffs = new List <BuffKeySpell>();

            mightBuffs.AddRange(Caster.Valor);
            mightBuffs.AddRange(Rogue.Might);

            DesperateAttack = new BuffStatus(Activity, Rogue.DesperateAttack);
            Invisible       = new InvisibleStatus(Activity, Rogue.Invisible);
            LethalStrike    = new BuffStatus(Activity, Rogue.LethalStrike);
            Fury            = new BuffStatus(Activity, Rogue.Fury);
            Might           = new BuffStatus(Activity, mightBuffs);
            Rage            = new RageStatus(self, Rogue.Cunning);
            ShadowFigure    = new BuffStatus(Activity, Rogue.ShadowFigure);
        }
예제 #20
0
        // Use this for initialization
        void Awake()
        {
            //Initialize Module Linking
            audios                    = GetComponents <AudioSource>();
            m_RigidBody2D             = GetComponent <Rigidbody2D>();
            buffStatus                = new BuffStatus();
            morphoStatus              = new MorphoStatus[350];
            morphoStatus[0]           = new MorphoStatus();
            morphoStatus[1]           = new MorphoStatus();
            morphoStatus[1].Gravity   = 0;
            morphoStatus[1].Jump      = 5f;
            morphoStatus[201]         = new MorphoStatus();
            morphoStatus[201].Gravity = 0;
            morphoStatus[201].Jump    = 0;
            morphoStatus[201].Speed   = 0;
            morphoStatus[301]         = new MorphoStatus();
            morphoStatus[301].Gravity = 0;
            morphoStatus[301].Jump    = 0;
            morphoStatus[301].Speed   = 0;
            BuffTimer                 = new Dictionary <string, float>();
            BuffWatcher               = new List <string>();

            if (MaxHp == 0)
            {
                MaxHp = 100;
            }
            hp = maxhp;

            SubDecorations         = new Dictionary <string, GameObject>();
            SubDecorations["hero"] = GameObject.Find("deco_hero");
            SubDecorations["hero"].SetActive(true);
            SubDecorations["rocket"] = GameObject.Find("deco_rocket");
            SubDecorations["rocket"].SetActive(false);
            SubDecorations["helmet"] = GameObject.Find("deco_helmet");
            SubDecorations["helmet"].SetActive(false);

            particleList             = new Dictionary <string, ParticleSystem>();
            particleList["dust"]     = transform.Find("Par_Dust").GetComponent <ParticleSystem>();
            particleList["dec"]      = transform.Find("Par_Dec").GetComponent <ParticleSystem>();
            particleList["flame"]    = transform.Find("Par_Flame").GetComponent <ParticleSystem>();
            particleList["missiled"] = transform.Find("Par_Missled").GetComponent <ParticleSystem>();
            particleList["sheild"]   = transform.Find("Par_Sheild").GetComponent <ParticleSystem>();
            particleList["slip"]     = transform.Find("Par_Slip").GetComponent <ParticleSystem>();

            shooterGroup    = new SimpleShooter[2];
            shooterGroup[0] = transform.Find("Add_ShooterLeft").GetComponent <SimpleShooter>();
            shooterGroup[1] = transform.Find("Add_ShooterRight").GetComponent <SimpleShooter>();
        }
예제 #21
0
        /// <summary>
        /// Assigns attack spells from the Mage's spell inventory.
        /// </summary>
        /// <param name="self">The game client data for the Mage.</param>
        public MageAttackCommands(MageClient self) : base(self)
        {
            _self = self;

            _hellfireSpell  = self.Spells.KeySpells.Hellfire;
            _hellfireStatus = self.Status.Hellfire;
            _infernoSpell   = self.Spells.KeySpells.Inferno;
            _infernoStatus  = self.Status.Inferno;

            if (self.Inventory.KeyItems.SulSlashOrb == null)
            {
                return;
            }

            _sulSlashOrb    = new KeySpell(self.Inventory.KeyItems.SulSlashOrb);
            _sulSlashStatus = self.Status.SulSlash;
        }
예제 #22
0
        public static async Task <bool> CastAetheredTargetableSpell(
            TkClient caster,
            KeySpell spell,
            BuffStatus status,
            Npc target,
            bool isLowCostSpell = false)
        {
            if (await CastAetheredTargetableSpell(caster, spell, status, target.Uid, $"NPC {target.Uid}", isLowCostSpell))
            {
                return(true);
            }

            if (spell != null) // Indicates that the target is off-screen without having to repeat the relatively inefficient IsTargetOffScreen() check
            {
                caster.Npcs.Remove(target);
            }

            return(false);
        }
예제 #23
0
        public void ManagerBuffPlayer(string pExpectedBuff)
        {
            switch (pExpectedBuff)
            {
            case "Speed":
                _buffStatus = BuffStatus.SpeedBuff;
                _coroutine  = StartCoroutine(RemainedBuffed(_speedDuration));

                break;

            case "Range":
                _buffStatus = BuffStatus.RangeBuff;
                _coroutine  = StartCoroutine(RemainedBuffed(_rangeDuration));
                break;

            default:
                Debug.Log("Ability Not Implemented");
                break;
            }
        }
예제 #24
0
        public static async Task <bool> CastAetheredSpell(
            TkClient caster,
            KeySpell spell,
            BuffStatus status,
            bool isLowCostSpell = false)
        {
            if (status.IsActive)
            {
                return(false);
            }

            var didCastSpell = await CastSpell(caster, spell, isLowCostSpell);

            if (didCastSpell)
            {
                status.ResetStatusCooldown();
            }

            return(didCastSpell);
        }
예제 #25
0
        /// <summary>
        /// Initializes a Warrior's status data.
        /// </summary>
        /// <param name="self">All game client data for the Warrior.</param>
        public WarriorStatus(WarriorClient self) : base(self.Activity)
        {
            Backstab  = new BuffStatus(Activity, Warrior.Backstab);
            Berserk   = new BuffStatus(Activity, Warrior.Berserk);
            Blessing  = new BuffStatus(Activity, Warrior.Blessing);
            Flank     = new BuffStatus(Activity, Warrior.Flank);
            Fury      = new BuffStatus(Activity, Warrior.Fury);
            Potence   = new BuffStatus(Activity, Warrior.Potence);
            SpotTraps = new BuffStatus(Activity, Warrior.SpotTraps);
            Whirlwind = new BuffStatus(Activity, Warrior.Whirlwind);

            switch (self.Spells.KeySpells.Rage?.AlignedName)
            {
            case "Sonhi Rage":
                Rage = new RageStatus(self, Warrior.SonhiRage);
                break;

            default:
                Rage = new RageStatus(self, Warrior.Rage);
                break;
            }
        }
예제 #26
0
        public static async Task <bool> CastAetheredTargetableSpell(
            TkClient caster,
            KeySpell spell,
            BuffStatus status,
            uint targetUid,
            string targetName,
            bool isLowCostSpell = false)
        {
            if (status.IsActive)
            {
                return(false);
            }

            var didCastSpell = await CastTargetableSpell(caster, spell, targetUid, targetName, isLowCostSpell);

            if (didCastSpell)
            {
                status.ResetStatusCooldown();
            }

            return(didCastSpell);
        }
예제 #27
0
        /// <summary>
        /// Update active buff list
        /// </summary>
        private void UpdateActiveBuffs(AppViewModel app)
        {
            Application.Current.Dispatcher.Invoke(() =>
            {
                app.ActiveBuffs.Clear();
            });

            var myName = app.Healer.Player.Name;

            foreach (var buff in app.Healer.Player.Buffs)
            {
                if (buff > 0)
                {
                    var status = new BuffStatus(myName, buff);
                    app.ActiveBuffs.Add(status);
                }
            }

            foreach (var playerBuff in app.Buffs)
            {
                app.ActiveBuffs.Add(playerBuff);
            }
        }
예제 #28
0
 /// <summary>
 /// Initializes a Mage's or Poet's status data.
 /// </summary>
 /// <param name="activity">The activity data of the Mage or Poet.</param>
 protected CasterStatus(TkActivity activity) : base(activity)
 {
     Invoke = new BuffStatus(Activity, Caster.Invoke);
 }
예제 #29
0
 /// <summary>
 /// Initializes a Poet's status data.
 /// </summary>
 /// <param name="activity">The activity data of the Poet.</param>
 public PoetStatus(TkActivity activity) : base(activity)
 {
     HardenBody = new BuffStatus(Activity, Poet.HardenBody);
     Restore    = new BuffStatus(Activity, Poet.Restore);
 }