Dancer_A

Target Tile Dynamic coloring

Dec 21st, 2025 (edited)
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.34 KB | None | 0 0
  1. ## Target Tile dynamic coloring
  2. ## Event_Processor_Commands.cs
  3. ## replace existing command_target_tile(), around line 1269
  4. private bool command_target_tile()
  5.         private bool command_target_tile()
  6.         {
  7.             switch (command.Value[0])
  8.             {
  9.                 case "Unit":
  10.                     // Value[0] = "Unit"
  11.                     // Value[1] = unit id
  12.                     // Value[2] = time (optional)
  13.                     // Value[3] = color (optional, red by default, true or false) true = white, false = red
  14.                     int id = process_unit_id(command.Value[1]);
  15.                     if (!Global.game_map.units.ContainsKey(id))
  16.                     {
  17.                         throw new ArgumentException("No unit with this id exists");
  18.                         return true;
  19.                     }
  20.                     Game_Unit unit = Global.game_map.units[id];
  21.                     if (command.Value.Length < 3)
  22.                         Global.player.target_tile(unit.loc);
  23.                     else if (command.Value.Length == 3)
  24.                         Global.player.target_tile(unit.loc, process_number(command.Value[2]));
  25.                     else
  26.                         Global.player.target_tile(unit.loc, process_number(command.Value[2]), process_bool(command.Value[3]));
  27.                     Index++;
  28.                     break;
  29.                 default:
  30.                     // Value[0] = x
  31.                     // Value[1] = y
  32.                     // Value[2] = time (optional)
  33.                     // Value[3] = color (optional, red by default, true or false) true = white, false = red
  34.                     if (command.Value.Length < 3)
  35.                         Global.player.target_tile(new Vector2(process_number(command.Value[0]), process_number(command.Value[1])));
  36.                     else if (command.Value.Length == 3)
  37.                         Global.player.target_tile(new Vector2(process_number(command.Value[0]), process_number(command.Value[1])), process_number(command.Value[2]));
  38.                     else
  39.                         Global.player.target_tile(new Vector2(process_number(command.Value[0]), process_number(command.Value[1])), process_number(command.Value[2]), process_bool(command.Value[3]));
  40.                     Index++;
  41.                     break;
  42.             }
  43.             return true;
  44.         }
  45.  
  46. ## Player.cs
  47. ## replace existing update_target(), around line 401
  48.         protected bool update_target()
  49.         {
  50.             if (Target_Timer > -1)
  51.             {
  52.                 // Should the cursor be a different color during events/pre-chapter? //Debug
  53.                 if (Facing == 6)
  54.                     Facing = 4; //battle_map? 4 : 2 //Yeti <-- change this to 2 for white frame, 4 for red frame
  55.                 return false;
  56.             }
  57.             return true;
  58.         }
  59.  
  60. ## add beneath the existing target_tile(Vector2 target_loc, int time), around line 424; you will have 3 target_tile functions
  61.         public void target_tile(Vector2 target_loc, int time, bool facing)
  62.         {
  63.             if (time != -1)
  64.                 Target_Timer = time;
  65.             else
  66.                 Target_Timer = 48;
  67.             Loc = target_loc;
  68.             refresh_real_loc();
  69.             if (facing)
  70.                 Facing = 2; // white
  71.             else
  72.                 Facing = 4; // red
  73.         }
  74.  
Advertisement
Add Comment
Please, Sign In to add comment