mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 00:38:46 +00:00
Add half-done grouped region frame stuff so Ryley can take a look. This is in master because I'm an idiot.
This commit is contained in:
@@ -4,28 +4,30 @@ java_import 'org.apollo.game.action.DistancedAction'
|
||||
class OpenDoorAction < DistancedAction
|
||||
include DoorConstants
|
||||
|
||||
attr_reader :door_object
|
||||
attr_reader :door
|
||||
|
||||
def initialize(mob, door_object)
|
||||
super(0, true, mob, door_object.position, DOOR_SIZE)
|
||||
@door_object = door_object
|
||||
def initialize(mob, door)
|
||||
super(0, true, mob, door.position, DOOR_SIZE)
|
||||
@door = door
|
||||
end
|
||||
|
||||
def executeAction
|
||||
mob.turn_to @door_object.position
|
||||
DoorUtil::toggle(@door_object, mob)
|
||||
mob.turn_to(@door.position)
|
||||
DoorUtil::toggle(@door, mob)
|
||||
stop
|
||||
end
|
||||
|
||||
def equals(other)
|
||||
return (get_class == other.get_class && @door_object == other.door_object)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Message handler for opening and closing doors.
|
||||
on :message, :first_object_action do |ctx, player, message|
|
||||
if DoorUtil::is_door?(message.id)
|
||||
door_object = DoorUtil::get_door_object(message.position, message.id)
|
||||
player.start_action(OpenDoorAction.new(player, door_object)) unless door_object.nil?
|
||||
puts "Player: #{player.position}, door: #{message.position}"
|
||||
door = DoorUtil::get_door_object(message.position, message.id)
|
||||
player.start_action(OpenDoorAction.new(player, door)) unless door.nil?
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user