Пример #1
0
    public void promoteSkill(int skillClass)
    {
        int randomSkillFlag;

        if (skillClass == 1)
        {
            randomSkillFlag = Random.Range(0, 2);

            directSkill = SkillTypeList.instance.GetData(directSkill.nextSkillIdList[randomSkillFlag]);
        }

        else if (skillClass == 2)
        {
            randomSkillFlag = Random.Range(0, 2);

            indirectSkill = SkillTypeList.instance.GetData(indirectSkill.nextSkillIdList[randomSkillFlag]);
        }

        else if (skillClass == 3)
        {
            randomSkillFlag = Random.Range(0, 2);

            blockSkill = SkillTypeList.instance.GetData(blockSkill.nextSkillIdList[randomSkillFlag]);
        }
    }
Пример #2
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="_timer"></param>
 /// <param name="_skill"></param>
 /// <param name="_target"></param>
 public WorkLog(float _timer, long _skill, UnitModel _target, AgentModel _actor)
 {
     timer        = _timer;
     skill        = _skill;
     target       = _target;
     actor        = _actor;
     m_deleteFlag = false;
     skillInfo    = SkillTypeList.instance.GetData(skill);
 }
Пример #3
0
    public void LoadData(Dictionary <string, object> dic)
    {
        //BinaryFormatter bf = new BinaryFormatter();
        //Dictionary<string, object> dic = (Dictionary<string, object>)bf.Deserialize(stream);
        TryGetValue(dic, "instanceId", ref instanceId);

        TryGetValue(dic, "name", ref name);
        TryGetValue(dic, "hp", ref hp);
        //output.Add("traitList",

        TryGetValue(dic, "gender", ref gender);
        TryGetValue(dic, "level", ref level);
        TryGetValue(dic, "workDays", ref workDays);

        TryGetValue(dic, "expFail", ref expFail);
        TryGetValue(dic, "expSuccess", ref expSuccess);
        TryGetValue(dic, "expHpDamage", ref expHpDamage);
        TryGetValue(dic, "expMentalDamage", ref expMentalDamage);

        TryGetValue(dic, "maxHp", ref maxHp);
        TryGetValue(dic, "maxMental", ref maxMental);

        TryGetValue(dic, "mental", ref mental);
        TryGetValue(dic, "movement", ref movement);
        TryGetValue(dic, "work", ref work);

        TryGetValue(dic, "prefer", ref prefer);
        TryGetValue(dic, "preferBonus", ref preferBonus);
        TryGetValue(dic, "reject", ref reject);
        TryGetValue(dic, "rejectBonus", ref rejectBonus);

        long id = 0;

        TryGetValue(dic, "directSkillId", ref id);
        directSkill = SkillTypeList.instance.GetData(id);
        id          = 0;
        TryGetValue(dic, "indirectSkillId", ref id);
        indirectSkill = SkillTypeList.instance.GetData(id);
        id            = 0;
        TryGetValue(dic, "blockSkillId", ref id);
        blockSkill = SkillTypeList.instance.GetData(id);

        TryGetValue(dic, "imgsrc", ref imgsrc);
        TryGetValue(dic, "speechTable", ref speechTable);
        TryGetValue(dic, "panicType", ref panicType);

        TryGetValue(dic, "currentSefira", ref currentSefira);
    }
Пример #4
0
    public void UpdateSKill(string skillType)
    {
        SkillTypeInfo newSkill = null;

        if (skillType == "direct")
        {
            newSkill = SkillTypeList.instance.GetNextSkill(directSkill);
            if (newSkill == null)
            {
                return;
            }
            directSkill = newSkill;
        }
        else if (skillType == "indirect")
        {
            newSkill = SkillTypeList.instance.GetNextSkill(indirectSkill);
            if (newSkill == null)
            {
                return;
            }
            indirectSkill = newSkill;
        }
        else if (skillType == "block")
        {
            newSkill = SkillTypeList.instance.GetNextSkill(blockSkill);
            if (newSkill == null)
            {
                return;
            }
            blockSkill = newSkill;
        }
        else
        {
            return;
        }
    }
        void BaseOnClick(AgentModel actor)
        {
            CommandWindow.CommandWindow CurrentWindow = CommandWindow.CommandWindow.CurrentWindow;

            if (actor == null || CurrentWindow == null)
            {
                return;
            }


            if (CurrentWindow.CurrentWindowType == CommandType.Management)
            {
                if (!actor.CheckWorkCommand())
                {
                    CurrentWindow.SetAgentList(CurrentWindow.CurrentWindowType, CurrentWindow.CurrentSefira);
                    return;
                }
                CreatureModel currentTarget = CurrentWindow.CurrentTarget as CreatureModel;
                if (actor.GetState() == AgentAIState.MANAGE)
                {
                    if (currentTarget == actor.target)
                    {
                        if (actor.currentSkill == null)
                        {
                            actor.ForcelyCancelWork();
                        }
                        return;
                    }
                    if (actor.currentSkill != null)
                    {
                        actor.StopAction();
                    }
                    else
                    {
                        actor.ForcelyCancelWork();
                    }
                }
                SkillTypeInfo data = SkillTypeList.instance.GetData(CurrentWindow.SelectedWork);
                actor.ManageCreature(currentTarget, data, CurrentWindow.GetWorkSprite((RwbpType)((int)CurrentWindow.SelectedWork)));
                actor.counterAttackEnabled = false;
                currentTarget.Unit.room.OnWorkAllocated(actor);
                currentTarget.script.OnWorkAllocated(data, actor);
                AngelaConversation.instance.MakeMessage(AngelaMessageState.MANAGE_START, new object[] { actor, data, CurrentWindow.CurrentTarget as CreatureModel });
                CurrentWindow.CloseWindow();
            }
            else if (CurrentWindow.CurrentWindowType != CommandType.KitCreature)
            {
                if (actor.GetState() == AgentAIState.SUPPRESS_CREATURE && actor.target == CurrentWindow.CurrentTarget)
                {
                    actor.ForcelyCancelSuppress();
                    return;
                }
                if (actor.GetState() == AgentAIState.SUPPRESS_WORKER && actor.targetWorker == CurrentWindow.CurrentTarget)
                {
                    actor.ForcelyCancelSuppress();
                    return;
                }
                actor.Suppress(CurrentWindow.CurrentTarget, false);
            }
            else
            {
                CreatureModel creatureModel = CurrentWindow.CurrentTarget as CreatureModel;
                if (actor.GetState() == AgentAIState.MANAGE)
                {
                    if (creatureModel == actor.target)
                    {
                        if (actor.currentSkill == null)
                        {
                            actor.ForcelyCancelWork();
                        }
                        return;
                    }
                    if (actor.currentSkill != null)
                    {
                        actor.StopAction();
                    }
                    else
                    {
                        actor.ForcelyCancelWork();
                    }
                }
                actor.ManageKitCreature(creatureModel);
                actor.counterAttackEnabled = false;
                creatureModel.Unit.room.OnWorkAllocated(actor);
                CurrentWindow.CloseWindow();
            }
        }