コード例 #1
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 11);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            SimpleLayout.Label("Get the hero objects here:");
            GetHeroObjectField.BuildFieldB("", actionParams, heroAction.actionFields[10]);

            SimpleLayout.Label("Hero object to reference:");
            GetHeroObjectField.BuildFieldA("", actionParams, heroAction.actionFields[3]);

            SimpleLayout.Label("Longest distance objects can be from this hero object:");
            SimpleLayout.BeginHorizontal();
            bool useX = GetBoolValue.BuildField("X", actionParams, heroAction.actionFields[4]);
            bool useY = GetBoolValue.BuildField("Y", actionParams, heroAction.actionFields[5]);
            bool useZ = GetBoolValue.BuildField("Z", actionParams, heroAction.actionFields[6]);

            SimpleLayout.EndHorizontal();

            if (useX || useY || useZ)
            {
                SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
                if (showContent(heroAction, 4))
                {
                    GetFloatField.BuildFieldA("X:", actionParams, heroAction.actionFields[7], true);
                }
                if (showContent(heroAction, 5))
                {
                    GetFloatField.BuildFieldA("Y:", actionParams, heroAction.actionFields[8], true);
                }
                if (showContent(heroAction, 6))
                {
                    GetFloatField.BuildFieldA("Z:", actionParams, heroAction.actionFields[9], true);
                }
                SimpleLayout.EndVertical();
            }
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            SimpleLayout.Label("Operation:");
            GetDropDownField.BuildField("", actionParams, heroAction.actionFields[0], new HeroObjectOperatorField());
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            SimpleLayout.Label("Save the hero objects here:");
            GetHeroObjectField.BuildFieldB("", actionParams, heroAction.actionFields[1]);

            SimpleLayout.Label("Maximum number of hero objects to save:");
            GetIntegerField.BuildFieldA("", actionParams, heroAction.actionFields[2]);
            SimpleLayout.EndVertical();
        }
コード例 #2
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 4);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldB("Integer A:", actionParams, heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetDropDownField.BuildField("Operator:", actionParams, heroAction.actionFields[2], new MathOperatorField());
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Integer B:", actionParams, heroAction.actionFields[3]);
            SimpleLayout.EndVertical();
        }
コード例 #3
0
ファイル: ShakeCameraFields.cs プロジェクト: antfitch/HeroKit
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 5);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetCameraField.BuildField("", actionParams, heroAction.actionFields[0], heroAction.actionFields[4]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Speed of shaking:", actionParams, heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Magnitude of shaking:", actionParams, heroAction.actionFields[2]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Amount of time to shake the camera:", actionParams, heroAction.actionFields[3]);
            SimpleLayout.EndVertical();
        }
コード例 #4
0
ファイル: Skill006.cs プロジェクト: zhoulk/RTSDotaClient
    void AttackTo(BaseHero from, BaseHero hero)
    {
        from.ReduceMP(expend);
        hero.ReduceHP(attackHP);
        UnityTools.Log(from.name + " 使用 " + name + " 攻击 " + hero.name + " 造成 " + attackHP + " 点伤害,眩晕" + dizzDuration + "毫秒,消耗 " + expend + "点MP");

        HeroAction treatAction = new HeroAction();

        treatAction.action = HeroActionType.Skill;
        SkillAction skillAction = new SkillAction();

        skillAction.action = SkillActionType.MiniMP;
        skillAction.args   = new object[] { expend };
        treatAction.args   = new object[] { from, hero, this, skillAction };
        from.AddAction(treatAction);

        HeroAction treatAction1 = new HeroAction();

        treatAction1.action = HeroActionType.Skill;
        SkillAction skillAction1 = new SkillAction();

        skillAction1.action = SkillActionType.MiniHP;
        skillAction1.args   = new object[] { attackHP };
        treatAction1.args   = new object[] { from, hero, this, skillAction1 };
        hero.AddAction(treatAction1);

        Buff buff = new Buff();

        buff.type     = BuffType.Dizzy;
        buff.start    = now;
        buff.duration = dizzDuration;
        hero.AddBuff(buff);
    }
コード例 #5
0
ファイル: AddCurrencyFields.cs プロジェクト: antfitch/HeroKit
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 2);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);

            // list of values
            string[] items = new string[RpgEditor.HeroKitCommon.moneyDatabase.propertiesList.properties.Count];
            for (int i = 0; i < RpgEditor.HeroKitCommon.moneyDatabase.propertiesList.properties.Count; i++)
            {
                items[i] = RpgEditor.HeroKitCommon.moneyDatabase.propertiesList.properties[i].itemProperties.strings.items[0].value;
            }
            GetDropDownField.BuildField("Currency type:", actionParams, heroAction.actionFields[0], new GenericListField(items));
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("New value:", actionParams, heroAction.actionFields[1]);
            SimpleLayout.EndVertical();
        }
コード例 #6
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 4);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetStringField.BuildFieldA("The name of the pool:", actionParams, heroAction.actionFields[0]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("The number of objects to add to the pool:", actionParams, heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            string[] items  = { "Hero Object", "Prefab" };
            int      result = GetDropDownField.BuildField("Object type: ", actionParams, heroAction.actionFields[2], new GenericListField(items));

            // prefab
            if (result == 2)
            {
                GetPrefabValue.BuildField("Prefab used by the object pool:", actionParams, heroAction.actionFields[3]);
            }
            SimpleLayout.EndVertical();
        }
コード例 #7
0
    // Separate queue for enemy actions so they can attack while you are still making choices
    // Single queue for choices so attacks don't happen simultaneously
    // public Queue<???> choiceQueue;

    // Use this for initialization
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
        DontDestroyOnLoad(gameObject);         // Save the BattleManager

        // Begin setup
        ChooseStage();
        SpawnParty();
        string chosenEnemies = ChooseEnemies();

        SpawnEnemies(chosenEnemies);
        PauseAllActionBars();         //

        // May need to reorganize this part
        activeHeroTag  = "";
        activeEnemyTag = "";
        heroAction     = hero.GetComponent <HeroAction> ();
        fightButton.SetActive(false);

        InitGame();
        doingSetup = false;
        // Begin battle, move to Update
    }
コード例 #8
0
        // --------------------------------------------------------------
        // Action Fields
        // --------------------------------------------------------------

        /// <summary>
        /// Create the action fields on a hero object if they don't exist.
        /// </summary>
        /// <remarks>This is used by HeroKit.Editor.ActionBlockFields classes.</remarks>
        /// <param name="heroAction">The Hero Action to update (part of Hero Object).</param>
        /// <param name="fieldCount">The number of Action fields to add to the Hero Action.</param>
        public static void CreateActionFieldsOnHeroObject(HeroAction heroAction, int fieldCount)
        {
            // only create the fields if they don't already exist
            if (heroAction.actionFields == null || heroAction.actionFields.Count != fieldCount)
            {
                // create new list if it doesn't exist or if new list should be empty
                if (heroAction.actionFields == null || fieldCount == 0)
                {
                    heroAction.actionFields = new List <HeroActionField>();
                }

                // if there are more fields in the old list, cut out fields no longer needed
                else if (heroAction.actionFields.Count > fieldCount)
                {
                    // 12 in old list, need 10 in new list
                    int index = fieldCount;
                    int count = heroAction.actionFields.Count - fieldCount;
                    heroAction.actionFields.RemoveRange(index, count);
                }

                // if there are fewer fields in the old list, insert number of fields needed
                else if (heroAction.actionFields.Count < fieldCount)
                {
                    // 3 in old list, need 5 in new list
                    int index = heroAction.actionFields.Count - 1;
                    for (int i = index; i < fieldCount; i++)
                    {
                        heroAction.actionFields.Add(new HeroActionField());
                    }
                }
            }
        }
コード例 #9
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 4);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldD("The hero object to save:", actionParams, heroAction.actionFields[3], false);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetDropDownField.BuildField("Operation:", actionParams, heroAction.actionFields[0], new HeroObjectOperatorField());
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldB("Save the hero object here:", actionParams, heroAction.actionFields[1]);
            GetIntegerField.BuildFieldA("Maximum number of hero objects to save:", actionParams, heroAction.actionFields[2]);
            SimpleLayout.EndVertical();
        }
コード例 #10
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 4);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            // Field: Skip (hidden, only for else if)
            GetConditionalField.BuildField(actionParams, heroAction.actionFields[0]);

            // Field: Integer A
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldB("Hero Object A:", actionParams, heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            // Field: Operator
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetDropDownField.BuildField("Operator:", actionParams, heroAction.actionFields[2], new TrueFalseField());
            SimpleLayout.EndVertical();

            // Field: Integer B
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldA("Hero Object B:", actionParams, heroAction.actionFields[3]);
            SimpleLayout.EndVertical();
        }
コード例 #11
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 5);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Update a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetChildObjectField.BuildField("Is collider on a child object?", actionParams, heroAction.actionFields[2], heroAction.actionFields[3]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetDropDownField.BuildField("The type of collider to update:", actionParams, heroAction.actionFields[4], new ColliderTypeField());
            SimpleLayout.EndVertical();
        }
コード例 #12
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 4);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Change move settings for a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            bool changeLayers = GetBoolValue.BuildField("Object can only jump on things in specific layers?", actionParams, heroAction.actionFields[2], true);

            if (changeLayers)
            {
                GetLayerMaskValue.BuildField("", actionParams, heroAction.actionFields[3]);
            }
            SimpleLayout.EndVertical();
        }
コード例 #13
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            HeroObject targetObject = GetHeroObjectField.BuildFieldE("Work with an event on a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);

            SimpleLayout.EndVertical();

            // Field: Event
            if (targetObject != null)
            {
                SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
                GetEventField.BuildField("", actionParams, heroAction.actionFields[2], targetObject);
                SimpleLayout.EndVertical();
            }
        }
コード例 #14
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            HeroObject targetHO = GetHeroObjectField.BuildFieldC("Get string from this hero object template:", actionParams, heroAction.actionFields[0]);

            if (targetHO != null)
            {
                GetStringField.BuildFieldC("The string:", actionParams, heroAction.actionFields[1], targetHO);
            }
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetStringField.BuildFieldB("Save the string here:", actionParams, heroAction.actionFields[2]);
            SimpleLayout.EndVertical();
        }
コード例 #15
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 4);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Rotate a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            string[] direction = { "Clockwise", "Counterclockwise" };
            GetDropDownField.BuildField("Direction to rotate:", actionParams, heroAction.actionFields[2], new GenericListField(direction));
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Speed:", actionParams, heroAction.actionFields[3]);
            SimpleLayout.EndVertical();
        }
コード例 #16
0
        /// <summary>
        /// Get the template assigned to a hero object field.
        /// This is for a field that contains Variable, Property, Global.
        /// </summary>
        /// <param name="heroKitObject">The hero kit object that contains the data for this action.</param>
        /// <param name="actionFieldID">ID assigned to action field A.</param>
        /// <returns>The template assigned to a hero object field.</returns>
        public static HeroObject GetValueC(HeroKitObject heroKitObject, int actionFieldID)
        {
            // Get the action
            HeroAction action = heroKitObject.heroState.heroEvent[heroKitObject.heroStateData.eventBlock].actions[heroKitObject.heroStateData.action];

            // set up the target hero object type
            HeroObject targetHeroObject = null;

            // Get the game object data
            HeroObjectFieldData goData = new HeroObjectFieldData();

            goData.heroKitObject = heroKitObject;
            goData.heroList      = goData.heroKitObject.heroList;
            goData.objectType    = action.actionFields[actionFieldID].ints[0];
            goData.objectID      = action.actionFields[actionFieldID].ints[1];
            goData.heroGUID      = action.actionFields[actionFieldID].ints[4];
            goData.propertyID    = action.actionFields[actionFieldID].ints[5];

            // get hero object from a file
            if (goData.objectType == 1)
            {
                targetHeroObject = action.actionFields[actionFieldID].heroObjects[0];
            }
            // get hero object from elsewhere
            else
            {
                targetHeroObject = HeroObjectTargetField.GetTemplate(goData);
            }

            return(targetHeroObject);
        }
コード例 #17
0
ファイル: MoveImageFields.cs プロジェクト: antfitch/HeroKit
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 5);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Image ID:", actionParams, heroAction.actionFields[0]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Speed:", actionParams, heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetFloatField.BuildFieldA("New X Pos:", actionParams, heroAction.actionFields[2]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetFloatField.BuildFieldA("New Y Pos:", actionParams, heroAction.actionFields[3]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetBoolValue.BuildField("Don't play next action until this action completes?", actionParams, heroAction.actionFields[4], true);
            SimpleLayout.EndVertical();
        }
コード例 #18
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 17);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Play audio on another object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[4]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetUnityObjectField.BuildFieldA <AudioClip>("The sound effect to play:", actionParams, heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetBoolValue.BuildField("Fade BGM while sound effect plays?", actionParams, heroAction.actionFields[2], true);
            GetBoolValue.BuildField("Fade BGS while sound effect plays?", actionParams, heroAction.actionFields[3], true);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            bool changeSettings = GetBoolValue.BuildField("Change SE settings?", actionParams, heroAction.actionFields[5], true);

            if (changeSettings)
            {
                // this takes 11 action fields. actionField[x] to actionField[x+11]
                ActionCommon.GetAudioSettings(actionParams, heroAction, 6);
            }
            SimpleLayout.EndVertical();
        }
コード例 #19
0
ファイル: HeroItem.cs プロジェクト: zhoulk/RTSDotaClient
    public void Update()
    {
        if (baseHero != null)
        {
            if (baseHero.ActionCnt() > 0)
            {
                HeroAction action = baseHero.GetAction();
                if (action != null)
                {
                    switch (action.action)
                    {
                    case HeroActionType.Attack:
                        Attack();
                        break;

                    case HeroActionType.Hurt:
                        Hurt(action.args);
                        break;

                    case HeroActionType.Skill:
                        Skill(action.args);
                        break;

                    default:
                        break;
                    }
                }
            }

            HPPercentFontImage.fillAmount = (float)(baseHero.hp / baseHero.maxHp);
            MPPercentFontImage.fillAmount = (float)(baseHero.mp / baseHero.maxMp);
        }
    }
コード例 #20
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            // Field: bottom value
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Lowest value:", actionParams, heroAction.actionFields[0]);
            SimpleLayout.EndVertical();

            // Field: top value
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldA("Highest value:", actionParams, heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            // Field: save result here
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetIntegerField.BuildFieldB("Save result here:", actionParams, heroAction.actionFields[2]);
            SimpleLayout.EndVertical();
        }
コード例 #21
0
ファイル: SinkFields.cs プロジェクト: antfitch/HeroKit
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 5);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Sink a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetFloatField.BuildFieldA("Length of time to sink:", actionParams, heroAction.actionFields[2]);
            GetFloatField.BuildFieldA("Force of the sink:", actionParams, heroAction.actionFields[3]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetBoolValue.BuildField("Play next action before this action completes?", actionParams, heroAction.actionFields[4], true);
            SimpleLayout.EndVertical();
        }
コード例 #22
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 6);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Move a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetFloatField.BuildFieldA("Force of the jump:", actionParams, heroAction.actionFields[2]);

            string[] items  = { "jump straight up", "jump left", "jump right" };
            int      result = GetDropDownField.BuildField("Which directions can object jump?:", actionParams, heroAction.actionFields[3], new GenericListField(items));

            if (result > 1)
            {
                GetIntegerField.BuildFieldA("Force of the direction (0 to 100):", actionParams, heroAction.actionFields[4]);
            }
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetBoolValue.BuildField("Play next action before this action completes?", actionParams, heroAction.actionFields[5], true);
            SimpleLayout.EndVertical();
        }
コード例 #23
0
    void AttackTo(BaseHero from, BaseHero hero)
    {
        from.ReduceHP(expend, true);
        hero.ReduceHP(attackHP);
        UnityTools.Log(from.name + " 使用 " + name + " 攻击 " + hero.name + " 造成 " + attackHP + " 点伤害,消耗 " + expend + "点血量");

        HeroAction treatAction = new HeroAction();

        treatAction.action = HeroActionType.Skill;
        SkillAction skillAction = new SkillAction();

        skillAction.action = SkillActionType.MiniHP;
        skillAction.args   = new object[] { expend };
        treatAction.args   = new object[] { from, hero, this, skillAction };
        from.AddAction(treatAction);

        HeroAction treatAction1 = new HeroAction();

        treatAction1.action = HeroActionType.Skill;
        SkillAction skillAction1 = new SkillAction();

        skillAction1.action = SkillActionType.MiniHP;
        skillAction1.args   = new object[] { attackHP };
        treatAction1.args   = new object[] { from, hero, this, skillAction1 };
        hero.AddAction(treatAction1);
    }
コード例 #24
0
ファイル: ChangeLayerFields.cs プロジェクト: antfitch/HeroKit
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 4);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("Change the layer for a different hero object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetBoolValue.BuildField("Include hero object's children?", actionParams, heroAction.actionFields[2], true);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            SimpleLayout.Label("The new layer for the hero object:");
            GetDropDownField.BuildField("", actionParams, heroAction.actionFields[3], new LayerListField());
            SimpleLayout.EndVertical();
        }
コード例 #25
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetObjectValue.BuildField <TextAsset>("The CSV file to localize:", actionParams, heroAction.actionFields[0], false);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            bool localizeAudio = GetBoolValue.BuildField("Localize audio in messages? (If yes, enter path)", actionParams, heroAction.actionFields[1], true);

            if (localizeAudio)
            {
                GetStringField.BuildFieldA("", actionParams, heroAction.actionFields[2]);
            }
            SimpleLayout.EndVertical();
        }
コード例 #26
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 5);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetHeroObjectField.BuildFieldE("The script with the property is on a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            MonoScript script = GetUnityObjectField.BuildFieldA <MonoScript>("The script on the hero object:", actionParams, heroAction.actionFields[2]);

            // select the property to change
            if (script != null)
            {
                GetPropertyField.BuildFieldC("The property in the script to save on the hero object:", actionParams, heroAction.actionFields[3], heroAction.actionFields[4], script);
            }
            SimpleLayout.EndVertical();
        }
コード例 #27
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 10);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            HeroObject targetHeroObject = GetHeroObjectField.BuildFieldE("Animate a different object?", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);

            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            bool changeBegin = GetBoolValue.BuildField("Change jump begin animation?", actionParams, heroAction.actionFields[2], true);

            if (changeBegin)
            {
                ActionCommon.GetAnimation("The animation to show when jump begins:", actionParams, heroAction.actionFields[3], heroAction.actionFields[4], heroAction.actionFields[5], AnimatorControllerParameterType.Trigger, targetHeroObject);
            }
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            bool changeEnd = GetBoolValue.BuildField("Change jump end animation?", actionParams, heroAction.actionFields[6], true);

            if (changeEnd)
            {
                ActionCommon.GetAnimation("The animation to show when jump ends:", actionParams, heroAction.actionFields[7], heroAction.actionFields[8], heroAction.actionFields[9], AnimatorControllerParameterType.Trigger, targetHeroObject);
            }
            SimpleLayout.EndVertical();
        }
コード例 #28
0
        public static void BuildField(HeroActionParams actionParams)
        {
            HeroAction heroAction = actionParams.heroAction;

            //-----------------------------------------
            // create the action fields if they don't exist
            //-----------------------------------------
            ActionCommon.CreateActionFieldsOnHeroObject(heroAction, 3);

            //-----------------------------------------
            // create the fields for this action
            //-----------------------------------------
            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            GetSceneObjectValue.BuildField("layer", actionParams, heroAction.actionFields[0], heroAction.actionFields[1]);
            SimpleLayout.EndVertical();

            SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB);
            string[] items = new string[32];
            for (int i = 0; i < 32; i++)
            {
                items[i] = "Layer " + i + ": " + LayerMask.LayerToName(i);
            }
            GetDropDownField.BuildField("Use this layer:", actionParams, heroAction.actionFields[2], new GenericListField(items));
            SimpleLayout.EndVertical();
        }
コード例 #29
0
    // Returns false if selection is bad
    public bool makeSelectionFromHUD(int row, int col) {
        if (col == 0) {
            selectedCharacter = (HeroCharacter)row;
            selectedAction = HeroAction.Basic;

            selectedTargetId = selectEnemyByLooking();
        }
        else if (col == 1 && row != 2) {
            selectedCharacter = (HeroCharacter)row;
            selectedAction = HeroAction.Special;

            selectedTargetId = selectEnemyByLooking();

            if (!activeHeroes[(int)selectedCharacter].hasEnoughMp()) {
                return false;
            }
        }
        else if (col == 2) {
            selectedCharacter = HeroCharacter.Cadence;
            selectedAction = HeroAction.Special;
            selectedTargetId = row;

            if (!cadenceCombat.hasEnoughMp()) {
                return false;
            }
        }
        else {
            return false;
        }

        if (activeHeroes[(int)selectedCharacter].isDead()) {
            return false;
        }

        return true;
    }