//public override void Apply(BaseObject target)
        //{
        //    target.HandleHealEffect(this, Amount);
        //}
        public IEnumerator Knockback(Characters.Character source, ActionProduct action, Characters.Character target)
        {
            //yield return null;
            yield return(new WaitForSeconds(_delay));

            var direction = action.Direction;

            direction.Normalize();

            float i        = 0;
            float distance = 0;

            while (distance < _distance)
            {
                var speed = _stepSpeed * Mathf.Pow(_stepDiscount, i);

                if (target.Physic.MoveVelocity.magnitude < speed)
                {
                    target.Physic.MoveVelocity = speed * direction;
                }
                distance += speed;
                i++;

                yield return(new WaitForSeconds(_stepDuration));
            }

            yield return(null);
        }
Exemplo n.º 2
0
        public void DelPlayer(Characters.Character character)
        {
            Send(string.Concat("GM|-", character.ID));

            lock (Characters)
                Characters.Remove(character);
        }
Exemplo n.º 3
0
        public GuildCollector(Maps.Map map, Characters.Character owner, int id)
        {
            ID        = id;
            IsInFight = false;
            Guild     = owner.Guild;

            Map           = map;
            Map.Collector = this;

            Owner = owner.ID;
            Cell  = owner.MapCell;
            Dir   = 3;

            Name = new int[2] {
                Utilities.Basic.Rand(1, 39), Utilities.Basic.Rand(1, 71)
            };

            timer          = new Timer();
            timer.Enabled  = true;
            timer.Interval = Utilities.Basic.Rand(5000, 15000);
            timer.Elapsed += new ElapsedEventHandler(this.Move);
            timer.Start();

            Map.Send(string.Concat("GM", PatternMap()));
        }
Exemplo n.º 4
0
 public override void Use(Characters.Character source)
 {
     foreach (var a in _actions)
     {
         a.Use(source);
     }
 }
Exemplo n.º 5
0
 public override void UseAgainst(Characters.Character source, BaseObject target)
 {
     foreach (var a in _actions)
     {
         a.UseAgainst(source, target);
     }
 }
Exemplo n.º 6
0
        public static void OpenBank(Characters.Character character)
        {
            if (!Entities.Requests.BanksRequests.BanksList.Any(x => x.Owner == character.NClient.Infos.ID))
            {
                var newBank = new Bank()
                {
                    Owner     = character.NClient.Infos.ID,
                    Kamas     = 0,
                    IsNewBank = true
                };

                Entities.Requests.BanksRequests.BanksList.Add(newBank);
            }

            var bank  = Entities.Requests.BanksRequests.BanksList.First(x => x.Owner == character.NClient.Infos.ID);
            var price = bank.Items.Count;

            if (price != 0 && price > character.Kamas)
            {
                character.NClient.Send("Im182");
                return;
            }

            character.Kamas -= price;
            character.SendChararacterStats();

            BanksExchanges.Add(new BankExchange(bank, character));

            character.NClient.Send("ECK5|");
            character.NClient.Send(string.Format("EL{0};G{1}", bank.GetExchangeItems(), bank.Kamas));
            character.State.OnExchangeWithBank = true;
        }
 public void UpdateOnHitSettings(Characters.Character owner, float baseDamage, LayerMask ignore, float persistTime)
 {
     this.owner      = owner;
     this.baseDamage = baseDamage;
     this.ignore     = ignore;
     killTime        = Time.time + persistTime;
 }
Exemplo n.º 8
0
 protected override void OnCast(Characters.Character character, uint power)
 {
     if (character.Condition == Characters.Character.ConditionType.poisoned)
     {
         character.Condition = Characters.Character.ConditionType.healthy;
     }
 }
Exemplo n.º 9
0
 public void UpdateOnHitSettings(Characters.Character owner, Weapon wep, LayerMask ignore, float persistTime)
 {
     this.owner  = owner;
     weapon      = wep;
     this.ignore = ignore;
     killTime    = Time.time + persistTime;
 }
Exemplo n.º 10
0
 protected override void OnCast(Characters.Character character, uint power)
 {
     if (character.Condition != Characters.Character.ConditionType.invulnerable)
     {
         character.Hp -= power;
     }
 }
Exemplo n.º 11
0
        private void Start()
        {
            targetStats = target.GetComponent <Characters.Character>();
            foreach (var c in FindObjectsOfType <Canvas>())
            {
                if (c.renderMode == RenderMode.WorldSpace)
                {
                    ui           = Instantiate(uiPrefab, c.transform).transform;
                    healthSlider = ui.Find("HealthMask/HealthBar").GetComponent <Image>();
                    shieldSlider = ui.Find("HealthMask/ShieldBar").GetComponent <Image>();

                    try
                    {
                        var enemyStats = (EnemyStats)targetStats;
                        var levelText  = ui.Find("LevelBackground/LevelText").GetComponent <TextMeshProUGUI>();
                        levelText.text = targetStats.level.ToString();
                        var enemyName = ui.Find("NameBackground/EnemyName").GetComponent <TextMeshProUGUI>();
                        enemyName.text = gameObject.name;
                        var enemyStars = ui.Find("LevelBackground/Stars").GetComponent <Image>();
                        enemyStars.sprite = starsContainer[enemyStats.stars - 1];
                    } catch { /*Ignored*/ }

                    ui.gameObject.SetActive(false);
                    break;
                }
            }

            targetStats.OnHealthChanged += OnHealthChanged;
        }
Exemplo n.º 12
0
        public ExchangePlayer(Characters.Character _character)
        {
            IsNpc     = false;
            Character = _character;

            Items = new List <ExchangeItem>();
        }
Exemplo n.º 13
0
        public override bool Verify(Characters.Character source, Characters.Character target)
        {
            Attributes.StatResource.StatPersistence stat1 = source.Attributes.GetStat(_tag);
            Attributes.StatResource.StatPersistence stat2 = source.Attributes.GetStat(_tag);

            float value1, value2 = 0;

            switch (_mode)
            {
            case Mode.Ratio:
                value1 = stat1.Current / stat1.Total;
                value2 = stat2.Current / stat2.Total;
                break;

            case Mode.Current:
                value1 = stat1.Current / stat1.Total;
                value2 = stat2.Current / stat2.Total;
                break;

            case Mode.Total:
                value1 = stat1.Current / stat1.Total;
                value2 = stat2.Current / stat2.Total;
                break;

            default:
                return(false);
            }

            return(_comparison.Verify(value1 - value2));
        }
Exemplo n.º 14
0
        public static void SendZaaps(Characters.Character character)
        {
            if (Entities.Requests.ZaapsRequests.ZaapsList.Any(x => x.MapID == character.MapID))
            {
                var zaap = Entities.Requests.ZaapsRequests.ZaapsList.First(x => x.MapID == character.MapID);

                if (!character.Zaaps.Contains(zaap.MapID))
                {
                    character.Zaaps.Add(zaap.MapID);
                    character.NClient.Send("Im024");
                }

                var savepos = (Entities.Requests.ZaapsRequests.ZaapsList.Any(x => x.MapID == character.SaveMap) ?
                               Entities.Requests.ZaapsRequests.ZaapsList.First(x => x.MapID == character.SaveMap).MapID.ToString() : "");
                var packet = string.Format("WC{0}|", savepos);

                Entities.Requests.ZaapsRequests.ZaapsList.Where(x => character.Zaaps.Contains(x.MapID)).ToList().
                ForEach(x => packet = string.Format("{0}{1};{2}|", packet, x.MapID, CalcPrice(character.GetMap(), x.Map)));

                character.NClient.Send(packet.Substring(0, packet.Length - 1));
            }
            else
            {
                character.NClient.Send("BN");
            }
        }
Exemplo n.º 15
0
        public static void NPCNeedFactory(Characters.Character character)
        {
            Debug.Log("In NPCNeedFactory");
            JSONNode j = Connect.GetJSONNode(new List <string> {
                "Need", "NeedData.json"
            });

            for (int i = 0; i < j["NPCNeed"].Count; i++)
            {
                Need charNeed = character.gameObject.AddComponent <Need>();

                //Debug.Log("name " + j["NPCNeed"][i]["needName"].Value);
                //Debug.Log("stati " + NeedStatusFactory(j, i));
                //Debug.Log("starting " + j["NPCNeed"][i]["startingValue"].AsInt);
                //Debug.Log("decrementvalue " + j["NPCNeed"][i]["valueDecrementRate"].AsInt);
                //Debug.Log("time " + j["NPCNeed"][i]["timeToDecrement"].AsInt);

                NeedData need = new NeedData(
                    j["NPCNeed"][i]["needName"].Value,
                    NeedStatusFactory(j, i),
                    j["NPCNeed"][i]["startingValue"].AsInt,
                    j["NPCNeed"][i]["valueDecrementRate"].AsInt,
                    j["NPCNeed"][i]["timeToDecrement"].AsInt
                    );
                charNeed.Init(need);
            }
        }
 private void DoApply2(ActionProduct action, Characters.Character target)
 {
     foreach (var item in _items)
     {
         target.InventoryUser.TryStore(item);
     }
 }
Exemplo n.º 17
0
        public static void OnMove(Characters.Character character, int nextZaapis)
        {
            if (Entities.Requests.ZaapisRequests.ZaapisList.Any(x => x.MapID == nextZaapis))
            {
                var zaapis = Entities.Requests.ZaapisRequests.ZaapisList.First(x => x.MapID == nextZaapis);

                if ((zaapis.Faction == 1 && character.Faction.ID == 2) || (zaapis.Faction == 2 && character.Faction.ID == 1))
                {
                    character.NClient.Send("Im1196");
                    return;
                }

                var price = (character.Faction.ID == zaapis.Faction ? 10 : 20);

                character.Kamas -= price;
                character.NClient.Send(string.Concat("Im046;", price));
                character.TeleportNewMap(zaapis.MapID, zaapis.CellID);

                character.NClient.Send("Wv");

                character.SendChararacterStats();
            }
            else
            {
                character.NClient.Send("BN");
            }
        }
Exemplo n.º 18
0
 public void OnTriggerEnter(Collider other)
 {
     if (_character == null)
     {
         _character = other.GetComponent <Characters.Character>();
     }
 }
Exemplo n.º 19
0
 /// <summary>
 /// Initializes the test map.
 /// </summary>
 public static void InitTestMap()
 {
     currentMapName = "????????";
     npcPosition    = new Vector2(200, 100);
     prop1Position  = new Vector2(200, 200);
     npc            = new Characters.NPCs.TestNPC(npcPosition);
 }
Exemplo n.º 20
0
 public void Init(Characters.Character character)
 {
     this.character = character;
     GetComponentInChildren <Animator>().runtimeAnimatorController = Characters.GetAnimation(character);
     characterImage.GetComponent <UnityEngine.UI.Image>().sprite   = Characters.GetSprite(character);
     armImage.GetComponent <UnityEngine.UI.Image>().sprite         = Characters.GetArm(character);
 }
Exemplo n.º 21
0
 public void UpdateOnHitSettings(Characters.Character owner, Vector3 dir, LayerMask ignore, float baseDamage)
 {
     this.owner        = owner;
     this.baseDamage   = baseDamage;
     incomingDirection = dir;
     ParticleSystem.CollisionModule coll = part.collision;
     coll.collidesWith = ~ignore;
 }
Exemplo n.º 22
0
        public IActionResult Random()
        {
            Random rng = new Random();

            CharacterCard character = new Characters.Character(20, ClassEnum.Barbarian.GetEnumText()).CreateNewCharacter();

            return(View(character));
        }
Exemplo n.º 23
0
 protected override void OnCast(Characters.Character character, uint power)
 {
     if (character.Condition != Characters.Character.ConditionType.invulnerable)
     {
         character.Hp -= (uint)new System.Random().Next(0, Math.Min((int)this.Power, (int)character.MaxHp) + 1);
         this.Power++;
     }
 }
        // JUST GIVE THE ITEM
        protected override void DoApply(ActionProduct action, Characters.Character target)
        {
            if (_isItemTransfer)
            {
                return;
            }

            DoApply2(action, target);
        }
Exemplo n.º 25
0
        private void ReflectDamage(Characters.Character source, Characters.Character target, float damage)
        {
            if (source == target)
            {
                return;
            }

            damage *= EffectPower;
            source.TakeDamage(TargetStats, damage, 0);
        }
        // TODO: Handle not destroying the object if condition not satisfied

        // TRANSFER THE ITEM IF EXISTS IN FIRST GUY's inv
        protected override void DoApply(Characters.Character source, ActionProduct action, Characters.Character target)
        {
            if (_isItemTransfer)
            {
                // TODO Give item to other character
            }
            else
            {
                DoApply2(action, target);
            }
        }
Exemplo n.º 27
0
 protected override void OnCast(Characters.Character character, uint power)
 {
     if (character.Condition != Characters.Character.ConditionType.invulnerable &&
         character.Condition != Characters.Character.ConditionType.dead)
     {
         this.power     = (int)power;
         this.character = character;
         Thread waitingThread = new Thread(LockCondition);
         waitingThread.Start();
     }
 }
Exemplo n.º 28
0
        public void OnTargetHit(Characters.Character source, BaseObject target)
        {
            _strategy.OnTargetHitFromCharacterHandler -= OnTargetHit;

            foreach (var ef in _resource.Effects)
            {
                target.TryApply(source, this, ef);
            }

            target.NotifyActionHandled(this);
        }
Exemplo n.º 29
0
 public override void Execute(Characters.Character caller, string[] args)
 {
     if (args.Length != 0)
     {
         ShowSyntax(caller);
     }
     else
     {
         caller.Save();
     }
 }
Exemplo n.º 30
0
 public override void Execute(Characters.Character caller, string[] args)
 {
     if (args.Length != 0)
     {
         ShowSyntax(caller);
     }
     else
     {
         caller.Notify("X: " + caller.Position.X + ", Y: " + caller.Position.Y);
     }
 }
Exemplo n.º 31
0
 public Player()
 {
     // make sure these don't start uninitialized
     Cards = new List<SkillCard>();
     LoyaltyCards = new List<LoyaltyCard>();
     CustomDraws  = new List<List<SkillCardColor>>();
     MutinyHand = new List<MutinyCard>();
     SuperCrisisCards = new List<SuperCrisisCard>();
     QuorumHand = new List<QuorumCard>();
     Titles  = new List<Titles>();
     Character = new Characters.Character();
 }
Exemplo n.º 32
0
        public Player(bool IsAI, int x_arg , int y_arg = -1 , bool isReversed = false)
        {
            X_loc = x_arg;
            if (y_arg == -1)
            {
                Y_loc = Game1.Variables.GameRectangle.Y + Game1.Variables.GameRectangle.Height -
                    Game1.Variables.CharacterSize.Height;
            }
            this.IsAI = IsAI;
            this.IsReversed = isReversed;

            Character_textures = new Characters.Character();
            boxCollision = new Collision.BoxCollision();
        }
Exemplo n.º 33
0
 public Fighter(Characters.Character player, int team)
 {
     Player = player;
     _team = team;
 }
Exemplo n.º 34
0
 public Exchange(Characters.Character new1, Characters.Character new2)
 {
     player1 = new1;
     player2 = new2;
 }
Exemplo n.º 35
0
        public void ParseEffect(Characters.Character client)
        {
            Client = client;

            switch (_ID)
            {
                case 110: // + Vie
                    AddLife();
                    break;

                case 111: // + PA
                    AddPA();
                    break;

                case 112: // + Dommage
                    AddDamage();
                    break;

                case 115: // + Coups critiques
                    AddCritic();
                    break;

                case 116: // - PO
                    SubPO();
                    break;

                case 117: // + PO
                    AddPO();
                    break;

                case 118: // + Force
                    AddStrenght();
                    break;

                case 119: // + Agilité
                    AddAgility();
                    break;

                case 122: // + Echec
                    AddFail();
                    break;

                case 123: // + Chance
                    AddLuck();
                    break;

                case 124: // + Wisdom
                    AddWisdom();
                    break;

                case 125: // + Vitalité
                    AddLife();
                    break;

                case 126: // + Intel
                    AddIntel();
                    break;

                case 128: // + PM
                    AddPM();
                    break;

                case 138: // + %Dommage
                    AddPercentDamage();
                    break;

                case 142: // + Dommage Physique
                    AddPhysicDamage();
                    break;

                case 143: // + Dommage Magique
                    AddMagicDamage();
                    break;

                case 152: // - Chance
                    SubLuck();
                    break;

                case 153: // - Vitalité
                    SubLife();
                    break;

                case 154: // - Agilité
                    SubAgility();
                    break;

                case 155: // - Intelligence
                    SubIntelligence();
                    break;

                case 156 : // - Sagesse
                    SubWisdom();
                    break;

                case 157: // - Force
                    SubStrenght();
                    break;

                case 158: // + Pods
                    AddPods();
                    break;

                case 159: // - Pods
                    SubPods();
                    break;

                case 160: // + Esquive PA
                    AddDodgePA();
                    break;

                case 161: // + Esquive PM
                    AddDodgePM();
                    break;

                case 162: // - Esquive PA
                    SubDodgePA();
                    break;

                case 163: // - Esquive PM
                    SubDodgePM();
                    break;

                case 164: // - Dommage
                    SubDamage();
                    break;

                case 168: // - PA
                    SubPA();
                    break;

                case 169: // - PM
                    SubPM();
                    break;

                case 171: // - Coups critiques
                    SubCritic();
                    break;

                case 172: // - Dommage Magique
                    SubMagic();
                    break;

                case 173: // - Dommage Physique
                    SubPhysic();
                    break;

                case 174: // + Initiative
                    AddInitiative();
                    break;

                case 175: // - Initiative
                    SubInitiative();
                    break;

                case 176: // + Prospection
                    AddProspection();
                    break;

                case 177: // - Prospection
                    SubProspection();
                    break;

                case 178: // + Soins
                    AddHeal();
                    break;

                case 179: // - Soins
                    SubHeal();
                    break;

                case 182: // + Invocations
                    AddMonster();
                    break;

                case 210: // + %Armure terre
                    AddArmorStrenght();
                    break;

                case 211: // + %Armure Chance
                    AddArmorLuck();
                    break;

                case 212: // + %Armure Agilité
                    AddArmorAgility();
                    break;

                case 213: // + %Armure Intelligence
                    AddArmorIntelligence();
                    break;

                case 214: // + %Armure Neutre
                    AddArmorNeutral();
                    break;

                case 215: // - %Armure Terre
                    SubArmorPercentStrenght();
                    break;

                case 216: // -%Armure Chance
                    SubArmorPercentLuck();
                    break;

                case 217: // - %Armure Agilité
                    SubArmorPercentAgility();
                    break;

                case 218: // - %Armure Intel
                    SubArmorPercentIntelligence();
                    break;

                case 219: // - %Armure Neutre
                    SubArmorPercentNeutral();
                    break;

                case 225: // + Dommage Piege
                    AddTrapDamage();
                    break;

                case 226: // + %Dommage Piege
                    AddTrapPercentDamage();
                    break;

                case 240: // + Armor Force
                    AddArmorStrenght();
                    break;

                case 241: // + Armor Chance
                    AddArmorLuck();
                    break;

                case 242: // + Armor Agilité
                    AddArmorAgility();
                    break;

                case 243: // + Armor Intelligence
                    AddArmorIntelligence();
                    break;

                case 244: // + Armor Neutre
                    AddArmorNeutral();
                    break;

                case 245: // - Armor Force
                    SubArmorStrenght();
                    break;

                case 246: // - Armor Chance
                    SubArmorLuck();
                    break;

                case 247: // - Armor Agilité
                    SubArmorAgility();
                    break;

                case 248: // - Armor Intel
                    SubArmorIntelligence();
                    break;

                case 249: // - Armor Neutre
                    SubArmorNeutral();
                    break;

                case 250: // + %Pvp Armor Force
                    AddArmorPvpStrenghtPercent();
                    break;

                case 251: // + %Pvp Armor Chance
                    AddArmorPvpLuckPercent();
                    break;

                case 252: // + %Pvp Armor Agilité
                    AddArmorPvpAgilityPercent();
                    break;

                case 253: // + %Pvp Armor Intel
                    AddArmorPvpIntelligencePercent();
                    break;

                case 254: // + %Pvp Armor Neutre
                    AddArmorPvpNeutralPercent();
                    break;

                case 255: // -%Pvp Armor Force
                    SubArmorPvpStrenghtPercent();
                    break;

                case 256: // - %Pvp Armor Chance
                    SubArmorPvpLuckPercent();
                    break;

                case 257: // -%Pvp Armor Agilité
                    SubArmorPvpAgilityPercent();
                    break;

                case 258: // -%Pvp Armor Intel
                    SubArmorPvpIntelligencePercent();
                    break;

                case 259: // -%Pvp Armor Neutre
                    SubArmorPvpNeutralPercent();
                    break;

                case 260: // + Pvp Armor Force
                    AddArmorPvpStrenght();
                    break;

                case 261: // + Pvp Armor Chance
                    AddArmorPvpLuck();
                    break;

                case 262: // + Pvp Armor Agilité
                    AddArmorPvpAgility();
                    break;

                case 263: // + Pvp Armor Intelligence
                    AddArmorPvpIntelligence();
                    break;

                case 264: // + Pvp Armor Neutre
                    AddArmorPvpNeutral();
                    break;
            }
        }