Beispiel #1
0
 public override void editor_layout(attack_entity attack_ref)
 {
     condition = (temporary_condition)EditorGUILayout.ObjectField(
         condition,
         typeof(temporary_condition),
         false);
 }
    public override void OnInspectorGUI()
    {
        temporary_condition condition_ref = target as temporary_condition;

        condition_ref.max_turns = EditorGUILayout.IntField("Duration:", condition_ref.max_turns);

        start = EditorGUILayout.Foldout(start, "On start effect");
        if (start)
        {
            condition_ref.on_start_s = EditorGUILayout.TextField("Target stat", condition_ref.on_start_s);
            EditorGUILayout.BeginHorizontal();
            condition_ref.on_start_m.op       = (operation)EditorGUILayout.EnumPopup(condition_ref.on_start_m.op);
            condition_ref.on_start_m.argument = EditorGUILayout.IntField(condition_ref.on_start_m.argument);
            EditorGUILayout.EndHorizontal();
            condition_ref.on_start_l = (effect_length)EditorGUILayout.EnumPopup(condition_ref.on_start_l);
            condition_ref.on_start_e = (GameObject)EditorGUILayout.ObjectField(
                condition_ref.on_start_e,
                typeof(GameObject),
                false);
        }

        turn = EditorGUILayout.Foldout(turn, "Each turn effect");
        if (turn)
        {
            condition_ref.on_turn_s = EditorGUILayout.TextField("Target stat", condition_ref.on_turn_s);
            EditorGUILayout.BeginHorizontal();
            condition_ref.on_turn_m.op       = (operation)EditorGUILayout.EnumPopup(condition_ref.on_turn_m.op);
            condition_ref.on_turn_m.argument = EditorGUILayout.IntField(condition_ref.on_turn_m.argument);
            EditorGUILayout.EndHorizontal();
            condition_ref.on_turn_l = (effect_length)EditorGUILayout.EnumPopup(condition_ref.on_turn_l);
            condition_ref.on_turn_e = (GameObject)EditorGUILayout.ObjectField(
                condition_ref.on_turn_e,
                typeof(GameObject),
                false);
        }

        end = EditorGUILayout.Foldout(end, "On end effect");
        if (end)
        {
            condition_ref.on_remove_s = EditorGUILayout.TextField("Target stat", condition_ref.on_remove_s);
            EditorGUILayout.BeginHorizontal();
            condition_ref.on_remove_m.op       = (operation)EditorGUILayout.EnumPopup(condition_ref.on_remove_m.op);
            condition_ref.on_remove_m.argument = EditorGUILayout.IntField(condition_ref.on_remove_m.argument);
            EditorGUILayout.EndHorizontal();
            condition_ref.on_remove_e = (GameObject)EditorGUILayout.ObjectField(
                condition_ref.on_remove_e,
                typeof(GameObject),
                false);
        }

        EditorUtility.SetDirty(condition_ref);
    }
Beispiel #3
0
 public override bool activate(rpg_character attacker, attack_entity triggering_attack)
 {
     if (triggering_attack.activated_effect)
     {
         temporary_condition new_condition = Object.Instantiate(condition) as temporary_condition;
         new_condition.source_character = attacker;
         new_condition.source_attack    = triggering_attack;
         new_condition.add_effect(attacker);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Beispiel #4
0
    public override bool activate(rpg_character attacker, attack_entity triggering_attack)
    {
        bool did_apply = false;

        for (int i = 0; i < triggering_attack.target_squares.Count; i++)
        {
            if (util_ref.e_manager.is_occupied(triggering_attack.target_squares[i]))
            {
                temporary_condition new_condition = Object.Instantiate(condition) as temporary_condition;
                new_condition.source_character = attacker;
                new_condition.source_attack    = triggering_attack;
                new_condition.add_effect(util_ref.e_manager.get_at_square(triggering_attack.target_squares[i]).GetComponent <rpg_character>());
                did_apply = true;
            }
        }
        return(did_apply);
    }