示例#1
0
        internal static float effective_multiplier(
            this Data_Weapon weapon,
            Tactile.Game_Unit unit,
            Tactile.Game_Unit target,
            bool halveOnHealingTerrain = true)
        {
            int effectiveness = 1;

            if (target == null)
            {
                return(effectiveness);
            }
            // Skills: Nullify
            if (target.actor.has_skill("NULL"))
            {
                return(effectiveness);
            }

            foreach (TactileLibrary.ClassTypes type in target.actor.actor_class.Class_Types)
            {
                if (weapon.Effectiveness[(int)type] > effectiveness)
                {
                    effectiveness = weapon.Effectiveness[(int)type];
                }
            }
            // Skills: Smite
            if (unit != null && unit.actor.has_skill("SMITE"))
            {
                if (target != null && !unit.nihil(target))
                {
                    if (target.actor.weapon != null && !weapon.is_staff() && (
                            target.actor.weapon.main_type().Name == "Dark" ||
                            target.actor.weapon.scnd_type().Name == "Dark"))
                    {
                        //target.actor.weapon.Main_Type == TactileLibrary.Weapon_Types.Dark || //Debug
                        //target.actor.weapon.Scnd_Type == TactileLibrary.Weapon_Types.Dark))
                        effectiveness = Math.Max(2, effectiveness);
                    }
                }
            }

            float result = effectiveness;

            if (halveOnHealingTerrain)
            {
                if (target.halve_effectiveness() && effectiveness > 1)
                {
                    result = 1 + (effectiveness - 1) / 2f;
                }
            }
            return(result);
        }
示例#2
0
        public static void read(this Dictionary <int, Tactile.Game_Unit> units, BinaryReader reader)
        {
            units.Clear();
            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                int id = reader.ReadInt32();
                Tactile.Game_Unit unit = new Tactile.Game_Unit();
                unit.read(reader);
                units.Add(id, unit);
            }
        }
示例#3
0
 internal static bool can_heal(this Data_Weapon weapon, Tactile.Game_Unit target)
 {
     if (weapon.Heals())
     {
         if (!target.actor.is_full_hp())
         {
             return(true);
         }
     }
     if (healable_statuses(weapon, target).Count > 0)
     {
         return(true);
     }
     return(false);
 }
示例#4
0
 internal static List <int> healable_statuses(this Data_Weapon weapon, Tactile.Game_Unit target)
 {
     return(weapon.Status_Remove.Intersect(target.actor.negative_states).ToList());
 }