Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## AI Ignore (ASMC)
- ## Credit to gooseish & Ryn
- ## Event_Processor_Commands.cs
- ## New ASMC case
- ## Place within the command value section inside of command_custom()
- ## line ~2842
- case "AI Ignore":
- #region Have the AI not acknowledge a specific unit
- // Value[1] = id
- // Value[2] = ignored unit id
- int ignorer_id = process_unit_id(command.Value[1]);
- int ignored_id = process_unit_id(command.Value[2]);
- Game_Unit ignorer_unit = null;
- if (ignorer_id == -1)
- if (Global.game_map.last_added_unit != null)
- ignorer_unit = Global.game_map.last_added_unit;
- if (Global.game_map.units.ContainsKey(ignorer_id))
- ignorer_unit = Global.game_map.units[ignorer_id];
- if (ignorer_unit != null)
- ignorer_unit.new_ai_ignore = ignored_id;
- break;
- #endregion
- ## Game_Unit.cs
- ## New property of Game_unit
- ## place in between 'protected int Mission = 0, Ai_Mission = 2;' and 'protected bool Dead = false;'
- ## line ~42
- protected List<int> Ai_Ignore = new List<int> { -1 };
- ## Add new writer within Serialization
- ## place after writer.Write(Ai_Mission); within public void write(BinaryWriter writer)
- ## line ~108
- Ai_Ignore.write(writer);
- ## add new reader within Serialization
- ## place after Ai_Mission = reader.ReadInt32(); within public void read(BinaryWriter reader)
- ## line ~162
- Ai_Ignore.read(reader);
- ## create new method
- ## place after full_ai_mission method
- ## line ~368
- public bool ai_ignores (int id)
- {
- return Ai_Ignore.Contains(id);
- }
- public int new_ai_ignore
- {
- set
- {
- Ai_Ignore.Add(value);
- }
- }
- ## Game_AI.cs
- ## within Regular Weapons region
- ## add two if checks
- ## line ~189
- #region Regular Weapons
- if (weapon_index != Global.ActorConfig.NumItems)
- {
- if (!attacker.ai_ignores(targetId)) //change this to just check if the target's id is not in the list of targets to ignore <-- new
- {
- targetUses = check_target(
- attacker, targetUnit, can_move, best, retreating,
- damage_test, retreat_loc, weapon_index);
- }
- }
- #endregion
- #region Siege Weapons
- else
- {
- if (!attacker.ai_ignores(targetId)) //change this to just check if the target's id is not in the list of targets to ignore <-- new
- {
- targetUses = check_siege_target(
- attacker, targetUnit, can_move, best,
- damage_test, weapon_index);
- }
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment