mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-07-22 23:57:01 +00:00
Update 6.8
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SecretBase
|
||||
attr_reader :outside_map_id #Id of the map where the secret base is
|
||||
attr_reader :inside_map_id #Id of the secret base's map itself
|
||||
|
||||
@@ -61,6 +61,9 @@ class SecretBaseItemInstance
|
||||
end
|
||||
|
||||
def interactable?(position = [0,0])
|
||||
return true#
|
||||
|
||||
#TODO
|
||||
return get_interactable_positions.include?(position)
|
||||
end
|
||||
|
||||
@@ -79,6 +82,7 @@ class SecretBaseItemInstance
|
||||
end
|
||||
|
||||
def calculate_occupied_volume_positions(main_event_position)
|
||||
return [] #TODO
|
||||
template = get_item_template
|
||||
|
||||
item_x, item_y = main_event_position
|
||||
|
||||
@@ -12,25 +12,21 @@ class SecretBaseItem
|
||||
attr_reader :pass_through # for carpets, etc.
|
||||
attr_reader :under_player # for carpets, etc.
|
||||
|
||||
attr_reader :height
|
||||
attr_reader :width
|
||||
#todo: instead of this, have a 2d array that represents the layout visually and shows which tiles are interactable and which aren't
|
||||
# ex:
|
||||
# [
|
||||
# [[x],[x],[x]],
|
||||
# [[i],[i],[i]
|
||||
# ]
|
||||
# -> 2 rows, only interactable from the bottom
|
||||
#
|
||||
attr_reader :collision_map #SecretBaseItemCollisionMap object
|
||||
|
||||
# Secret base object attributes
|
||||
attr_reader :deletable
|
||||
attr_reader :behavior # Lambda function that's defined when initializing the items. Some secret bases can have special effects when you interact with them (ex: a berry pot to grow berries, a bed, etc.)
|
||||
# -> This is the function that will be called when the player interacts with the item in the base.
|
||||
# Should just display flavor text for most basic items.
|
||||
attr_reader :uninteractable_positions #Positions at which the behavior won't trigger (relative to the center) ex: [[-1,0],[1,0]] in a 3x1 object will trigger in the center, but not on the sides
|
||||
attr_reader :trigger #Can define a different event trigger (Action Button by default)
|
||||
|
||||
def initialize(id:, graphics:, real_name:, price:, deletable: true, pass_through: false, under_player: false, behavior: nil, height:1, width:1, uninteractable_positions:[], trigger:TRIGGER_ACTION_BUTTON)
|
||||
attr_reader :uninteractable_positions # Positions at which the behavior won't trigger (relative to the center) ex: [[-1,0],[1,0]] in a 3x1 object will trigger in the center, but not on the sides
|
||||
attr_reader :trigger # Can define a different event trigger (Action Button by default)
|
||||
attr_reader :under_player # for carpets, etc.
|
||||
def initialize(id:, graphics:, real_name:, price:, deletable: true, pass_through: false, under_player: false,
|
||||
behavior: nil,
|
||||
trigger: TRIGGER_ACTION_BUTTON,
|
||||
collision_map: SecretBaseItemCollisionMap.new(:i))
|
||||
@id = id
|
||||
@graphics = graphics
|
||||
@real_name = real_name
|
||||
@@ -39,14 +35,16 @@ class SecretBaseItem
|
||||
@pass_through = pass_through
|
||||
@under_player = under_player
|
||||
|
||||
#Parts of the item that the player shouldn't be able to pass through
|
||||
@height = height
|
||||
@width = width
|
||||
# Parts of the item that the player shouldn't be able to pass through
|
||||
# @height = height
|
||||
# @width = width
|
||||
|
||||
# Default behavior just shows text if none provided
|
||||
@behavior = behavior
|
||||
@uninteractable_positions = uninteractable_positions
|
||||
@trigger = trigger
|
||||
|
||||
@collision_map = collision_map
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
# [:i]: Unpassable and Interactable
|
||||
# [:x]: Unpassable
|
||||
# [] : Passable
|
||||
|
||||
# ex:
|
||||
# [
|
||||
# [[:x],[:x],[:x]],
|
||||
# [[:i],[:i],[:i]
|
||||
# ]
|
||||
# -> 2 rows, only interactable from the bottom
|
||||
|
||||
|
||||
class SecretBaseItemCollisionMap
|
||||
attr_accessor :collision_map
|
||||
def initialize(collisions_array = [])
|
||||
@collision_map = collisions_array
|
||||
end
|
||||
|
||||
#todo
|
||||
def get_interactable_tiles
|
||||
|
||||
end
|
||||
#todo
|
||||
def get passable_tiles
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user