Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Target Tile dynamic coloring
- ## Event_Processor_Commands.cs
- ## replace existing command_target_tile(), around line 1269
- private bool command_target_tile()
- private bool command_target_tile()
- {
- switch (command.Value[0])
- {
- case "Unit":
- // Value[0] = "Unit"
- // Value[1] = unit id
- // Value[2] = time (optional)
- // Value[3] = color (optional, red by default, true or false) true = white, false = red
- int id = process_unit_id(command.Value[1]);
- if (!Global.game_map.units.ContainsKey(id))
- {
- throw new ArgumentException("No unit with this id exists");
- return true;
- }
- Game_Unit unit = Global.game_map.units[id];
- if (command.Value.Length < 3)
- Global.player.target_tile(unit.loc);
- else if (command.Value.Length == 3)
- Global.player.target_tile(unit.loc, process_number(command.Value[2]));
- else
- Global.player.target_tile(unit.loc, process_number(command.Value[2]), process_bool(command.Value[3]));
- Index++;
- break;
- default:
- // Value[0] = x
- // Value[1] = y
- // Value[2] = time (optional)
- // Value[3] = color (optional, red by default, true or false) true = white, false = red
- if (command.Value.Length < 3)
- Global.player.target_tile(new Vector2(process_number(command.Value[0]), process_number(command.Value[1])));
- else if (command.Value.Length == 3)
- Global.player.target_tile(new Vector2(process_number(command.Value[0]), process_number(command.Value[1])), process_number(command.Value[2]));
- else
- 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]));
- Index++;
- break;
- }
- return true;
- }
- ## Player.cs
- ## replace existing update_target(), around line 401
- protected bool update_target()
- {
- if (Target_Timer > -1)
- {
- // Should the cursor be a different color during events/pre-chapter? //Debug
- if (Facing == 6)
- Facing = 4; //battle_map? 4 : 2 //Yeti <-- change this to 2 for white frame, 4 for red frame
- return false;
- }
- return true;
- }
- ## add beneath the existing target_tile(Vector2 target_loc, int time), around line 424; you will have 3 target_tile functions
- public void target_tile(Vector2 target_loc, int time, bool facing)
- {
- if (time != -1)
- Target_Timer = time;
- else
- Target_Timer = 48;
- Loc = target_loc;
- refresh_real_loc();
- if (facing)
- Facing = 2; // white
- else
- Facing = 4; // red
- }
Advertisement
Add Comment
Please, Sign In to add comment