Szkielet (plik "#{game}/Data/Base/weapon.rb")
Spoiler:
Kod: Zaznacz cały
class RPG::Weapon
def initialize(id)
@id = id
initialize_general
initialize_settings
initialize_params
initialize_costs
initialize_damages
initialize_requirements
initialize_other
initialize_ratio
initialize_protection
end
def id
return @id
end
#Ogólne
def initialize_general
@name = ""
@icon_name = ""
@description = ""
@type = ""
@two_handed = false
end
def price=(n)
@price = n
end
def price
return @price
end
def type=(text)
@type = text
end
def name=(text)
@name = text
end
def icon_name=(text)
@icon_name = text
end
def description=(text)
@description = text
end
def type
return @type
end
def name
return @name
end
def icon_name
return @icon_name
end
def description
return @description
end
def two_handed=(value)
@two_handed = value
end
def two_handed
return @two_handed
end
#/Ogólne
#Ustawienia
def initialize_settings
@animation1_id = 0
@animation2_id = 0
@other_event_id = 0
@projectile_id = {}
@variance = 0
end
def variance=(n)
@variance = n
end
def variance
return @variance
end
def animation1_id=(n)
@animation1_id = n
end
def animation1_id
return @animation1_id
end
def animation2_id=(n)
@animation2_id = n
end
def animation2_id
return @animation2_id
end
def other_event_id=(n)
@other_event_id = n
end
def other_event_id
return @other_event_id
end
def projectile_id=(n)
@projectile_id = n
end
def projectile_id
return @projectile_id
end
#/Ustawienia
#Koszty
def initialize_costs
@sp_cost = 0
@stamina_cost = 0
@item_costs = {}
@weapon_costs = {}
end
def sp_cost=(n)
@sp_cost = n
end
def stamina_cost=(n)
@stamina_cost = n
end
def item_costs=(value)
@item_costs = value
end
def weapon_costs=(value)
@weapon_costs = value
end
def sp_cost
return @sp_cost
end
def stamina_cost
return @stamina_cost
end
def item_costs
return @item_costs
end
def weapon_costs
return @weapon_costs
end
#/Koszty
#Obrażenia
def initialize_damages
@damage_pierce = 0
@damage_slash = 0
@damage_bludgeon = 0
@damage_fire = 0
@damage_wind = 0
@damage_lightning = 0
@damage_earth = 0
@damage_water = 0
@damage_plant = 0
@damage_ice = 0
@damage_metal = 0
@damage_light = 0
@damage_darkness = 0
@damage_spirit = 0
@damage_poison = 0
end
def damage_pierce=(n)
@damage_pierce = n
end
def damage_slash=(n)
@damage_slash = n
end
def damage_bludgeon=(n)
@damage_bludgeon = n
end
def damage_fire=(n)
@damage_fire = n
end
def damage_wind=(n)
@damage_wind = n
end
def damage_lightning=(n)
@damage_lightning = n
end
def damage_earth=(n)
@damage_earth = n
end
def damage_water=(n)
@damage_water = n
end
def damage_plant=(n)
@damage_plant = n
end
def damage_ice=(n)
@damage_ice = n
end
def damage_metal=(n)
@damage_metal = n
end
def damage_light=(n)
@damage_light = n
end
def damage_darkness=(n)
@damage_darkneess = n
end
def damage_spirit=(n)
@damage_spirit = n
end
def damage_poison=(n)
@damage_poison = n
end
def damage_pierce
return @damage_pierce
end
def damage_slash
return @damage_slash
end
def damage_bludgeon
return @damage_bludgeon
end
def damage_fire
return @damage_fire
end
def damage_wind
return @damage_wind
end
def damage_lightning
return @damage_lightning
end
def damage_earth
return @damage_earth
end
def damage_water
return @damage_water
end
def damage_plant
return @damage_plant
end
def damage_ice
return @damage_ice
end
def damage_metal
return @damage_metal
end
def damage_light
return @damage_light
end
def damage_darkness
return @damage_darkness
end
def damage_spirit
return @damage_spirit
end
def damage_poison
return @damage_poison
end
#/Obrażenia
#Wymagania
def initialize_requirements
@abilities = {}
@min_str = 0
@min_dex = 0
@min_agi = 0
@min_int = 0
@min_maxsp = 0
@items = {}
@weapons = {}
@clips = {}
end
def clips=(v)
@clips = v
end
def clips
return @clips
end
def abilities=(value)
@abilities = value
end
def min_maxsp=(n)
@min_maxsp = n
end
def min_str=(n)
@min_str = n
end
def min_dex=(n)
@min_dex = n
end
def min_agi=(n)
@min_agi = n
end
def min_int=(n)
@min_int = n
end
def items=(value)
@items = value
end
def weapons=(value)
@weapons = value
end
def abilities
return @abilities
end
def min_maxsp
return @min_maxsp
end
def min_str
return @min_str
end
def min_dex
return @min_dex
end
def min_agi
return @min_agi
end
def min_int
return @min_int
end
def min_spd
return @min_spd
end
def items
return @items
end
def weapons
return @weapons
end
#/Wymagania
#Other
def initialize_other
@element_set = []
@plus_state_set = []
@minus_state_set = []
end
def element_set=(value)
@element_set = value
end
def plus_state_set=(value)
@plus_state_set = value
end
def minus_state_set=(value)
@minus_state_set = value
end
def element_set
return @element_set
end
def plus_state_set
return @plus_state_set
end
def minus_state_set
return @minus_state_set
end
#/Other
#Punkty obrażeń
def initialize_ratio
@pierce_ratio = 0
@slash_ratio = 0
@bludgeon_ratio = 0
@fire_ratio = 0
@wind_ratio = 0
@lightning_ratio = 0
@earth_ratio = 0
@water_ratio = 0
@plant_ratio = 0
@ice_ratio = 0
@metal_ratio = 0
@light_ratio = 0
@darkness_ratio = 0
@spirit_ratio = 0
@poison_ratio = 0
@str_ratio = 0
@dex_ratio = 0
@agi_ratio = 0
end
def str_rate=(n)
@str_rate = n
end
def dex_rate=(n)
@dex_rate = n
end
def agi_rate=(n)
@agi_rate = n
end
def str_rate
return @str_rate
end
def dex_rate
return @dex_rate
end
def agi_rate
return @agi_rate
end
def pierce_ratio=(n)
@pierce_ratio = n
end
def slash_ratio=(n)
@slash_ratio = n
end
def bludgeon_ratio=(n)
@bludgeon_ratio = n
end
def fire_ratio=(n)
@fire_ratio = n
end
def wind_ratio=(n)
@wind_ratio = n
end
def lightning_ratio=(n)
@lightning_ratio = n
end
def earth_ratio=(n)
@earth_ratio = n
end
def water_ratio=(n)
@water_ratio = n
end
def plant_ratio=(n)
@plant_ratio = n
end
def ice_ratio=(n)
@ice_ratio = n
end
def metal_ratio=(n)
@metal_ratio = n
end
def light_ratio=(n)
@light_ratio = n
end
def darkness_ratio=(n)
@darkness_ratio = n
end
def spirit_ratio=(n)
@spirit_ratio = n
end
def poison_ratio=(n)
@poison_ratio = n
end
def pierce_ratio
return @pierce_ratio
end
def slash_ratio
return @slash_ratio
end
def bludgeon_ratio
return @bludgeon_ratio
end
def fire_ratio
return @fire_ratio
end
def wind_ratio
return @wind_ratio
end
def lightning_ratio
return @lightning_ratio
end
def earth_ratio
return @earth_ratio
end
def water_ratio
return @water_ratio
end
def plant_ratio
return @pierce_ratio
end
def ice_ratio
return @ice_ratio
end
def metal_ratio
return @metal_ratio
end
def light_ratio
return @light_ratio
end
def darkness_ratio
return @darkness_ratio
end
def spirit_ratio
return @spirit_ratio
end
def poison_ratio
return @poison_ratio
end
#/Punkty obrażeń
#Ochrona
def initialize_protection
@protection_pierce = 0
@protection_slash = 0
@protection_bludgeon = 0
@protection_poison = 0
@protection_spirit = 0
@protection_fire = 0
@protection_wind = 0
@protection_lightning = 0
@protection_earth = 0
@protection_water = 0
@protection_plant = 0
@protection_ice = 0
@protection_metal = 0
@protection_light = 0
@protection_darkness = 0
end
def protection_pierce=(n)
@protection_pierce = n
end
def protection_slash=(n)
@protection_slash = n
end
def protection_bludgeon=(n)
@protection_bludgeon = n
end
def protection_poison=(n)
@protection_poison = n
end
def protection_spirit=(n)
@protection_spirit = n
end
def protection_fire=(n)
@protection_fire = n
end
def protection_wind=(n)
@protection_wind = n
end
def protection_lightning=(n)
@protection_lightning = n
end
def protection_earth=(n)
@protection_earth = n
end
def protection_water=(n)
@protection_water = n
end
def protection_plant=(n)
@protection_plant = n
end
def protection_ice=(n)
@protection_ice = n
end
def protection_metal=(n)
@protection_metal = n
end
def protection_light=(n)
@protection_light = n
end
def protection_darkness=(n)
@protection_darkness = n
end
def protection_pierce
return @protection_pierce
end
def protection_slash
return @protection_slash
end
def protection_bludgeon
return @protection_bludgeon
end
def protection_poison
return @protection_poison
end
def protection_spirit
return @protection_spirit
end
def protection_fire
return @protection_fire
end
def protection_wind
return @protection_wind
end
def protection_lightning
return @protection_lightning
end
def protection_earth
return @protection_earth
end
def protection_water
return @protection_water
end
def protection_plant
return @protection_plant
end
def protection_ice
return @protection_ice
end
def protection_metal
return @protection_metal
end
def protection_light
return @protection_light
end
def protection_darkness
return @protection_darkness
end
#Ochrona
#Parametry
def initialize_params
@hp = 0
@sp = 0
@stamina = 0
@hp_rec = 0
@sp_rec = 0
@stamina_rec = 0
@atk = 0
@pdef = 0
@mdef = 0
@eva = 0
@str = 0
@dex = 0
@agi = 0
@int = 0
end
def hp=(n)
@hp = n
end
def sp=(n)
@sp = n
end
def stamina=(n)
@stamina = n
end
def hp_rec=(n)
Spoiler:
Kod: Zaznacz cały
#WEAPONS
def load_weapon_general_data
rfile = File.open("Data/Base/weapon.rb", "rb")
texts = rfile.readlines.clone
rfile.close
return if texts == nil
text = ""
for i in 0..texts.size
next if texts[i] == nil
text = text + texts[i]
next if texts[i+1] == nil
text = text + "\n"
end
eval(text)
end
def load_weapons_data
$data_weapons = []
ids = []
for i in 1..Weapons
ids.push(i)
end
return if ids.empty?
for id in ids
$data_weapons[id] = RPG::Weapon.new(id)
load_weapon_basic_data(id)
end
end
def load_weapon_basic_data(id)
rfile = File.open("Data/Base/Weapons/weapon#{id}.rb", "rb")
texts = rfile.readlines
rfile.close
text = ""
for line in texts
text += line + "\n" unless line == nil
end
eval(text)
end
#/WEAPONS
Spoiler:
Kod: Zaznacz cały
id = 0
$data_weapons[id].name = ""
$data_weapons[id].icon_name = ""
$data_weapons[id].description = ""
$data_weapons[id].type = ""
$data_weapons[id].price = 0
$data_weapons[id].animation1_id = 0
$data_weapons[id].animation2_id = 0
$data_weapons[id].other_event_id = 0
$data_weapons[id].projectile_id = 0
$data_weapons[id].sp_cost = 0
$data_weapons[id].stamina_cost = 0
for b in 1...999
$data_weapons[id].item_costs[b] = 0
$data_weapons[id].weapon_costs[b] = 0
end
$data_weapons[id].damage_pierce = 0
$data_weapons[id].damage_slash = 0
$data_weapons[id].damage_bludgeon = 0
$data_weapons[id].damage_poison = 0
$data_weapons[id].damage_spirit = 0
$data_weapons[id].damage_fire = 0
$data_weapons[id].damage_wind = 0
$data_weapons[id].damage_lightning = 0
$data_weapons[id].damage_earth = 0
$data_weapons[id].damage_water = 0
$data_weapons[id].damage_plant = 0
$data_weapons[id].damage_ice = 0
$data_weapons[id].damage_metal = 0
$data_weapons[id].damage_light = 0
$data_weapons[id].damage_darkness = 0
$data_weapons[id].pierce_ratio = 0
$data_weapons[id].slash_ratio = 0
$data_weapons[id].bludgeon_ratio = 0
$data_weapons[id].poison_ratio = 0
$data_weapons[id].spirit_ratio = 0
$data_weapons[id].fire_ratio = 0
$data_weapons[id].wind_ratio = 0
$data_weapons[id].lightning_ratio = 0
$data_weapons[id].earth_ratio = 0
$data_weapons[id].water_ratio = 0
$data_weapons[id].plant_ratio = 0
$data_weapons[id].ice_ratio = 0
$data_weapons[id].metal_ratio = 0
$data_weapons[id].light_ratio = 0
$data_weapons[id].darkness_ratio = 0
$data_weapons[id].protection_pierce = 0
$data_weapons[id].protection_slash = 0
$data_weapons[id].protection_bludgeon = 0
$data_weapons[id].protection_poison = 0
$data_weapons[id].protection_spirit = 0
$data_weapons[id].protection_fire = 0
$data_weapons[id].protection_wind = 0
$data_weapons[id].protection_lightning = 0
$data_weapons[id].protection_earth = 0
$data_weapons[id].protection_water = 0
$data_weapons[id].protection_plant = 0
$data_weapons[id].protection_ice = 0
$data_weapons[id].protection_metal = 0
$data_weapons[id].protection_light = 0
$data_weapons[id].protection_darkness = 0
$data_weapons[id].abilities[1] = 0
$data_weapons[id].min_maxsp = 0
$data_weapons[id].min_str = 0
$data_weapons[id].min_dex = 0
$data_weapons[id].min_agi = 0
$data_weapons[id].min_int = 0
$data_weapons[id].items[1] = 0
$data_weapons[id].weapons[1] = 0
#$data_weapons[id].element_set.push(1)
#$data_weapons[id].plus_state_set.push(1)
#$data_weapons[id].minus_state_set.push(1)