Пример #1
0
            public MapleStatEffect GetAttackEffect(MapleCharacter chr, ISkill theSkill)
            {
                var mySkill    = theSkill ?? SkillFactory.GetSkill(Skill);
                var skillLevel = chr.GetSkillLevel(mySkill);

                if (mySkill.SkillId == 1009 || mySkill.SkillId == 10001009)
                {
                    skillLevel = 1;
                }
                return(skillLevel == 0 ? null : mySkill.GetEffect(skillLevel));
            }
Пример #2
0
 public void AddSkill(string key)
 {
     if (skills.ContainsKey(key))
     {
         return; // 이미 같은 종류 있으면 그냥 리턴. 같은 스킬 중복 불가.
     }
     skills.Add(key, SkillFactory.CreateSkill(gameObject, key));
     skills[key].SetOwner(this);
     skills[key].InitSkill();
     //skill.Activate();
 }
        public void Sr_Packet_Reset_Skill_Cooldown()
        {
            Skill skill = SkillFactory.CreateSkill(450);

            Character.Skills.Add(skill);

            skill.IsOnCooldown = true;
            Client.ReceivePacket($"sr {skill.CastId}");

            Check.That(skill.IsOnCooldown).IsFalse();
        }
Пример #4
0
 public MapleSummon(MapleCharacter owner, int skill, Point pos, SummonMovementType movementType)
 {
     Owner      = owner;
     SkillId    = skill;
     SkillLevel = owner.GetSkillLevel(SkillFactory.GetSkill(skill));
     if (SkillLevel == 0)
     {
         Console.WriteLine("Trying to create a summon for a char without the skill");
     }
     MovementType = movementType;
     Position     = pos;
 }
Пример #5
0
 public void AddSkill(SkillName name)
 {
     if (!HasSkill(name))
     {
         Skill s = SkillFactory.GetSkill(name);
         Skills.Add(s);
     }
     else
     {
         Console.WriteLine($"{Name} already knows {name}");
     }
 }
Пример #6
0
        private Skill GetFirstSkill()
        {
            var skillRow = _skillSheet.First().Value;

            Assert.IsNotNull(skillRow);

            var firstSkill = SkillFactory.Get(skillRow, 100, 100);

            Assert.IsNotNull(firstSkill);

            return(firstSkill);
        }
Пример #7
0
 public Skill(SkillData.RootObject data, BattleCharacterInfo user, int lv)
 {
     _user = user;
     Data  = data;
     Lv    = lv;
     if (data.SubID != 0)
     {
         SkillData.RootObject skillData = SkillData.GetData(Data.SubID);
         _subSkill = SkillFactory.GetNewSkill(skillData, user, lv);
         _subSkill.SetPartnerSkill(this);
     }
 }
Пример #8
0
 public DonothingSkill(SkillData.RootObject data, BattleCharacterInfo user, int lv)
 {
     Data         = data;
     Lv           = lv;
     _user        = user;
     _hasNoTarget = true;
     if (data.SubID != 0)
     {
         SkillData.RootObject skillData = SkillData.GetData(Data.SubID);
         _subSkill = SkillFactory.GetNewSkill(skillData, user, lv);
         _subSkill.SetPartnerSkill(this);
     }
 }
Пример #9
0
 public RecoverMPItemSkill(SkillData.RootObject data, int lv)
 {
     _hasNoTarget = false;
     Data         = data;
     Lv           = lv;
     _value       = data.ValueList[lv - 1];
     if (data.SubID != 0)
     {
         SkillData.RootObject skillData = SkillData.GetData(Data.SubID);
         _subSkill = SkillFactory.GetNewSkill(skillData, null, lv);
         _subSkill.SetPartnerSkill(this);
     }
 }
Пример #10
0
        public Nekoyume.Model.Skill.Skill GetDefaultAttackSkill()
        {
            var skillRow = _skillSheet.First().Value;

            Assert.NotNull(skillRow);

            Assert.Equal(GameConfig.DefaultAttackId, skillRow.Id);

            var defaultAttack = SkillFactory.Get(skillRow, 100, 100);

            Assert.NotNull(defaultAttack);
            return(defaultAttack);
        }
Пример #11
0
    private List <Skill> skills;                      //技能列表
                                                      // 数据 {skill1,skill2,skill3...}



    //初始化
    public Person(int personID, string personName, int blood, int blue, int physicsAttack, int specialAttack, int speed, int physicsDefense, int specialDefense, int lv, int currentExperience, int bloodGrowth, int specialAttackGrowth, int physicsAttackGrowth, int speedGrowth, int physicsDefenseGrowth, int specialDefenseGrowth, int blueGrowth, string attackAniPath, int imageType, int experience, int money)
    {
        //buffs
        this.buffs                = new List <Buff> {
        };
        this.skills               = new List <Skill> {
        };
        this.personID             = personID;
        this.personName           = personName;
        this.blood                = blood;
        this.bloodMax             = blood;
        this.blue                 = blue;
        this.blueMax              = blue;
        this.physicsAttack        = physicsAttack;
        this.specialAttack        = specialAttack;
        this.speed                = speed;
        this.physicsDefense       = physicsDefense;
        this.specialDefense       = specialDefense;
        this.bloodGrowth          = bloodGrowth;
        this.blueGrowth           = blueGrowth;
        this.physicsAttackGrowth  = physicsAttackGrowth;
        this.physicsAttackGrowth  = physicsAttackGrowth;
        this.speedGrowth          = speedGrowth;
        this.physicsDefenseGrowth = physicsDefenseGrowth;
        this.specialDefenseGrowth = specialDefenseGrowth;
        this.lv = lv;
        this.currentExperience = currentExperience;
        this.experienceList    = new ExperienceList();
        this.experienceMax     = CalculateExperienceMax();  //级经验上限公式待定....
        this.attackAniPath     = attackAniPath;
        this.imageType         = imageType;
        this.experience        = experience;
        this.money             = money;
        this.buffFactory       = new BuffFactory();
        this.skillFactory      = new SkillFactory();
        // 添加技能
        this.skills.Add(this.skillFactory.CreateSkill("普通攻击"));
        this.skills.Add(this.skillFactory.CreateSkill("无操作"));

        //初始化装备
        this.inventory = new Dictionary <string, Equipment> {
            { "Heads", null },
            { "Top", null },
            { "Bottom", null },
            { "Weapon", null },
            { "Armor", null },
            { "Accessorie", null },
        };

        //待添加...
    }
Пример #12
0
        /// <summary>
        /// Create orb instance
        /// </summary>
        /// <param name="p_SkillCaster"></param>
        /// <param name="p_OrbCaster"></param>
        /// <param name="p_OrbTarget"></param>
        /// <param name="p_OrbData"></param>
        /// <returns></returns>
        public static Orb Instantiate(ISkillCaster p_SkillCaster, IOrbCaster p_OrbCaster, IOrbTarget p_OrbTarget, OrbData p_OrbData)
        {
            Orb _orb = new Orb(p_OrbData);

            //Init some data
            _orb.SkillCaster = p_SkillCaster;
            _orb.OrbCaster   = p_OrbCaster;
            _orb.OrbTarget   = p_OrbTarget;

            #region Init action motion trigger
            if (p_OrbData.createActions != null)
            {
                for (int i = 0; i < p_OrbData.createActions.Length; i++)
                {
                    OrbAction ac = SkillFactory.CreateAction(p_OrbData.createActions[i]);
                    ac.Holder = _orb;
                    _orb.CreateActions.Add(ac);
                }
            }
            if (p_OrbData.triggerActions != null)
            {
                for (int i = 0; i < p_OrbData.triggerActions.Length; i++)
                {
                    OrbAction ac = SkillFactory.CreateAction(p_OrbData.triggerActions[i]);
                    ac.Holder = _orb;
                    _orb.TriggerActions.Add(ac);
                }
            }
            if (p_OrbData.destroyActions != null)
            {
                for (int i = 0; i < p_OrbData.destroyActions.Length; i++)
                {
                    OrbAction ac = SkillFactory.CreateAction(p_OrbData.destroyActions[i]);
                    ac.Holder = _orb;
                    _orb.DestroyActions.Add(ac);
                }
            }
            if (p_OrbData.motions != null)
            {
                for (int i = 0; i < p_OrbData.motions.Length; i++)
                {
                    OrbMotion mo = SkillFactory.CreateMotion(p_OrbData.motions[i]);
                    mo.Holder = _orb;
                    _orb.Motions.Add(mo);
                }
            }
            #endregion

            _orb.TriggerCreate();
            return(_orb);
        }
Пример #13
0
        void Awake()
        {
            NPC_Factory.InitialFactory(NPC_Factory.LoadFactory("NPC_Factory"));
            SkillFactory.InitialFactory(SkillFactory.LoadFactory("SkillFactory"));
            MonsterFactory.InitialFactory(MonsterFactory.LoadFactory("MonsterFactory"));
            ItemFactory.InitialFactory(ItemFactory.LoadFactory("ItemFactory"));
            StoreFactory.InitialFactory(StoreFactory.LoadFactory("StoreFactory"));
            World.Initial(World.LoadWorld("World"));
            StoryManager.InitialManager(Story.LoadStory("MainStory"));
            InputManager.InitialManager(new UnityInputManager());
            PlayerManager.InitialManager(new Player());

            PlayerManager.Instance.Player.Inventory.AddItem(ItemFactory.Instance.FindItem(6), 100);
        }
Пример #14
0
        public void GetInstanceThroughFactoryTest()
        {
            // Arrange
            var brainState = new BrainState();

            _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object))
            .Returns(brainState);
            var retorts = SkillFactory.GetInstance().GetSkill("retorts", _context.Object, _provider.Object);

            // Act

            // Assert
            Assert.NotNull(retorts);
        }
Пример #15
0
    public virtual void Init(BattleCharacter character, List <int> list)
    {
        _myself = character;

        for (int i = 0; i < list.Count; i++)
        {
            _skillList.Add(SkillFactory.GetNewSkill(list[i], _myself.Info, 1)); //等級填1是暫時的
        }

        if (_skillList.Count > 0)
        {
            _myself.SelectedSkill = _skillList[0];
        }
    }
Пример #16
0
 public CureLeastHPSkill(SkillData.RootObject data, BattleCharacterInfo user, int lv)
 {
     Data         = data;
     Lv           = lv;
     _user        = user;
     _hasNoTarget = false;
     _value       = data.ValueList[lv - 1];
     if (data.SubID != 0)
     {
         SkillData.RootObject skillData = SkillData.GetData(Data.SubID);
         _subSkill = SkillFactory.GetNewSkill(skillData, user, lv);
         _subSkill.SetPartnerSkill(this);
     }
 }
Пример #17
0
 public PoisonSkill(SkillData.RootObject data, BattleCharacterInfo user, int lv)
 {
     Data         = data;
     Lv           = lv;
     _user        = user;
     _hasNoTarget = false;
     _poison      = new Poison(Data.StatusID, lv);
     if (data.SubID != 0)
     {
         SkillData.RootObject skillData = SkillData.GetData(Data.SubID);
         _subSkill = SkillFactory.GetNewSkill(skillData, user, lv);
         _subSkill.SetPartnerSkill(this);
     }
 }
Пример #18
0
        public void CountAfterInitTest(int expected)
        {
            // Arrange
            var factory    = SkillFactory.GetInstance();
            var brainState = new BrainState();

            _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object))
            .Returns(brainState);

            // Act
            var actual = SkillFactory.Count;

            // Assert
            Assert.Equal(expected, actual);
        }
Пример #19
0
        public void GetSkillNonexistingTest()
        {
            // Arrange
            var factory    = SkillFactory.GetInstance();
            var brainState = new BrainState();

            _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object))
            .Returns(brainState);

            // Act
            var skill = factory.GetSkill("greetings_like_you_test_it", _context.Object, _provider.Object);

            // Assert
            Assert.Null(skill);
        }
Пример #20
0
        private ResourcesHandler()
        {
            // Load skill
            SkillFactory factory = new SkillFactory();

            Console.WriteLine("Start loading skills");
            try
            {
                Skills = factory.LoadSkill("skills.xml");
                Console.WriteLine("Finish loading skills");
            }
            catch (FileNotFoundException ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Пример #21
0
        public void GetSkillExistingAgainTest()
        {
            // Arrange
            var factory    = SkillFactory.GetInstance();
            var brainState = new BrainState();

            _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object))
            .Returns(brainState);

            // Act
            var skill  = factory.GetSkill("greetings", _context.Object, _provider.Object);
            var skill2 = factory.GetSkill("greetings", _context.Object, _provider.Object);

            // Assert
            Assert.Equal(skill, skill2);
        }
Пример #22
0
        protected sealed override void SetSkill()
        {
            base.SetSkill();

            var dmg      = (int)(ATK * 0.3m);
            var skillIds = StageSimulator.EnemySkillSheet.Values.Where(r => r.characterId == RowData.Id)
                           .Select(r => r.skillId).ToList();
            var enemySkills = Simulator.SkillSheet.Values.Where(r => skillIds.Contains(r.Id))
                              .ToList();

            foreach (var skillRow in enemySkills)
            {
                var skill = SkillFactory.Get(skillRow, dmg, 100);
                Skills.Add(skill);
            }
        }
Пример #23
0
    public void TestCureSkill()
    {
        if (SkillData.GetData(3) == null)
        {
            SkillData.Load();
        }

        CureSkill           cureSkill  = (CureSkill)SkillFactory.GetNewSkill(3, null, 1);
        BattleCharacterInfo Info       = new BattleCharacterInfo();
        TeamMember          teamMember = new TeamMember();

        teamMember.Init(3, true, 1);
        Info.Init(teamMember, 1);
        Debug.Log(Info.MEF + " " + cureSkill.Data.ValueList[0]);
        Assert.AreEqual(18, cureSkill.CalculateRecover(Info));
    }
Пример #24
0
        public IActionResult GetSkillFromBook(int jobId, int skillId)
        {
            SkillBook book = SkillFactory.GetSkillBook(jobId);

            if (book == null)
            {
                return(NotFound("Couldn't find skillbook"));
            }
            Skill skill = book.Skills.Where(c => c.id == skillId).FirstOrDefault();

            if (skill == null)
            {
                return(NotFound("Couldn't find skill in book"));
            }
            return(Json(skill));
        }
Пример #25
0
 private static Skill GetSkill(EquipmentItemOptionSheet.Row row, SkillSheet skillSheet,
                               IRandom random)
 {
     try
     {
         var skillRow = skillSheet.OrderedList.First(r => r.Id == row.SkillId);
         var dmg      = random.Next(row.SkillDamageMin, row.SkillDamageMax + 1);
         var chance   = random.Next(row.SkillChanceMin, row.SkillChanceMax + 1);
         var skill    = SkillFactory.Get(skillRow, dmg, chance);
         return(skill);
     }
     catch (InvalidOperationException)
     {
         return(null);
     }
 }
Пример #26
0
    public void Init(Unit caster)
    {
        // Test Needed
        this.caster = caster;

        for (int i = 0; i < 4; i++)
        {
            SkillCells[i] = new SkillCell();
            SkillCells[i].Init(caster);
            // 设置初始技能
            ISkill tmpSkill = SkillFactory.CreateSkill(caster.attributes.data.skills[i]);
            if (tmpSkill != null)
            {
                SkillCells[i].CurrentSkill = tmpSkill;
            }
        }
    }
Пример #27
0
    private void SetBossSkills()
    {
        switch (dynamicStatOne)
        {
        case DynamicStats.HP:
            equippedSkills.Add(SkillFactory.GetSkillByID(9002));
            break;

        case DynamicStats.INTELLIGENCE:
            equippedSkills.Add(SkillFactory.GetSkillByID(9003));
            break;

        case DynamicStats.POWER:
            equippedSkills.Add(SkillFactory.GetSkillByID(9001));
            break;
        }
    }
Пример #28
0
        public void AboutTest()
        {
            // Arrange
            var expected   = "Contains set of quick responses from easily extendable file.";
            var brainState = new BrainState();

            _provider.Setup(p => p.GetConversationState <BrainState>(_context.Object))
            .Returns(brainState);
            var retorts = SkillFactory.GetInstance().GetSkill("retorts", _context.Object, _provider.Object);

            // Act
            var actual = retorts.About;

            // Assert
            Assert.NotNull(actual);
            Assert.NotEmpty(actual);
            Assert.Equal(expected, actual);
        }
Пример #29
0
    //public IEnumerator RefreshTemporaryEffects()
    //{
    //    while(true)
    //    {
    //        yield return new WaitForSeconds(SkillConsts.TICK_TIME);

    //        int idx = 0;

    //        while(idx < temporaryEffects.Count)
    //        {
    //            if (temporaryEffects[idx].Refresh())
    //                RemoveTemporaryEffect(temporaryEffects[idx]);
    //            else
    //                idx++;
    //        }
    //    }
    //}

    //public void ClearTemporaryEffects()
    //{
    //    foreach (TemporaryEffect effect in temporaryEffects)
    //        effect.RemoveEffect();
    //    temporaryEffects.Clear();
    //}

    //public void RemoveTemporaryEffect(TemporaryEffect toBeRemoved)
    //{
    //    if (temporaryEffects.Contains(toBeRemoved))
    //    {
    //        toBeRemoved.ResetTimer(); // 재활용할 수 있으니 리셋.
    //        toBeRemoved.ResetStack(); // 스택도 여기서 리셋

    //        toBeRemoved.RemoveEffect();
    //        temporaryEffects.Remove(toBeRemoved);
    //    }
    //}

    //public void AddTemporaryEffect(TemporaryEffect toBeAdded)
    //{
    //    if (!temporaryEffects.Contains(toBeAdded))
    //    {
    //        toBeAdded.SetSubject(this);
    //        toBeAdded.ApplyEffect();
    //        temporaryEffects.Add(toBeAdded);
    //    }
    //    else
    //    {
    //        //Debug.Log("Stacking Up");
    //        toBeAdded.StackUp();
    //    }
    //}
    #endregion

    #region Skill
    public void AddSkill(string key)
    {
        //Debug.Log(key);
        if (skills.ContainsKey(key))
        {
            return; // 이미 같은 종류 있으면 그냥 리턴. 같은 스킬 중복 불가.
        }
        //Debug.Log("aaaa");
        skills.Add(key, SkillFactory.CreateSkill(gameObject, key));
        skills[key].SetOwner(this);
        skills[key].InitSkill();

        if (isActiveAndEnabled == true)
        {
            skills[key].Activate();
        }

        //Debug.Log(skills.Count);
    }
Пример #30
0
        public void OnChangeStatus(Actor sActor, MapEventArgs args)
        {
            Map.StatusArgs arg = (Map.StatusArgs)args;
            switch (arg.type)
            {
            case Map.StatusArgs.EventType.Add:
                foreach (Map.StatusArgs.StatusInfo i in arg.StatusList)
                {
                    Packets.Server.ExchangeAddition p1 = new SagaMap.Packets.Server.ExchangeAddition();
                    p1.SetID(sActor.id);
                    Skill info = SkillFactory.GetSkill(i.SkillID);
                    if (info != null)
                    {
                        p1.SetStatusID(info.addition);
                    }
                    else
                    {
                        p1.SetStatusID(i.SkillID);
                    }
                    p1.SetTime(i.time);
                    this.C.netIO.SendPacket(p1, C.SessionID);
                }
                break;

            case Map.StatusArgs.EventType.Remove:
                foreach (Map.StatusArgs.StatusInfo i in arg.StatusList)
                {
                    Packets.Server.DeleteExchangeAddition p1 = new SagaMap.Packets.Server.DeleteExchangeAddition();
                    p1.SetID(sActor.id);
                    Skill info = SkillFactory.GetSkill(i.SkillID);
                    if (info != null)
                    {
                        p1.SetStatusID(info.addition);
                    }
                    else
                    {
                        p1.SetStatusID(i.SkillID);
                    }
                    this.C.netIO.SendPacket(p1, C.SessionID);
                }
                break;
            }
        }
        public SolverDataManager(ProjectDataSet model, ConstraintSolverResult data)
        {
            _model = model;
            _solverResult = data;

            var jobFactory = new JobFactory();
            var skillFactory = new SkillFactory();
            var workerFactory = new WorkerFactory();
            var toolFactory = new ToolFactory();
            var zoneFactory = new ZoneFactory();
            var shiftFactory = new ShiftFactory();
            
            var shiftConverter = new ShiftConverter(shiftFactory);
            var skillConverter = new SkillConverter(skillFactory);
            var toolConverter = new ToolConverter(toolFactory, shiftConverter);
            var zoneConverter = new ZoneConverter(zoneFactory);
            var laborConverter = new LaborConverter(workerFactory, shiftConverter, skillConverter);
            var jobConverter = new JobConverter(jobFactory, skillConverter, toolConverter, zoneConverter);

            _shiftManager = new ShiftManager(shiftConverter, skillConverter, laborConverter, toolConverter);
            _jobManager = new JobManager(jobConverter);
            _zoneManager = new ZoneManager(zoneConverter);
        }
 private void InitializeSkills()
 {
     _skills = new ConcurrentDictionary<string, ISkill>();
     _skillFactory = new SkillFactory();
     _skillConverter = new SkillConverter(_skillFactory);
 }