Project1
标题:
公用备注
[打印本页]
作者:
3106345123
时间:
2014-12-22 17:47
标题:
公用备注
就是备注一个备注相当于备注几个备注的效果
(不然要写傻掉
)
作者:
taroxd
时间:
2014-12-22 17:55
在合适的时机(比如载入数据库时)分析备注,把公用备注替换成“几个备注”。
做得更绝一点的话,可以在合适的时机 eval 一段备注的内容。而“公用备注”的API可以定义在 RPG::BaseItem 里面。这个
没节操的
方法可以参考ITBS。
作者:
泉塚四季
时间:
2014-12-22 19:15
如果你是希望使用某个读取备注的脚本才想要做多备注的话,我还是建议你直接修改脚本本身比较方便
作者:
企鹅达达
时间:
2014-12-23 09:33
本帖最后由 企鹅达达 于 2014-12-23 09:46 编辑
我自用随便写的,你还要其他啥效果的话就自己改
module BASE_PGNOTE
BASE_CLASS_ID = 1 # 公用备注所在id,填0则无视
NO_BASE_CLASS_ID = [] # 不使用公用备注的id
EDD_CLASSFE = false # 是否将“特征”也列入公用设置。慎填!!!
BASE_ACTOR_ID = 5
NO_BASE_ACTOR_ID = []
BASE_ITEM_ID = 1
NO_BASE_ITEM_ID = [2]
BASE_WEAPON_ID = 0
NO_BASE_WEAPON_ID = []
BASE_ARMOR_ID = 1
NO_BASE_ARMOR_ID = []
BASE_EMENY_ID = 1
NO_BASE_EMENY_ID = []
BASE_MAP_ID = 1
NO_BASE_MAP_ID = [2,3,4]
end
$imported = {} if $imported.nil?
$imported["PG_BASE_NOTE"] = true
#==============================================================================
# ■ DataManager
#==============================================================================
module DataManager
#--------------------------------------------------------------------------
# alias method: load_database
#--------------------------------------------------------------------------
class <<self; alias load_database_pgitemnote load_database; end
def self.load_database
load_database_pgitemnote
load_pg_item_notes
end
#--------------------------------------------------------------------------
# new method: load_pg_item_notes
#--------------------------------------------------------------------------
def self.load_pg_item_notes
for classes in $data_classes
next if classes.nil?
classes.add_classespgnote
end
for actors in $data_actors
next if actors.nil?
actors.add_actorspgnote
end
for items in $data_items
next if items.nil?
items.add_itemspgnote
end
for weapons in $data_weapons
next if weapons.nil?
weapons.add_weaponspgnote
end
for armors in $data_armors
next if armors.nil?
armors.add_armorspgnote
end
for enemies in $data_enemies
next if enemies.nil?
enemies.add_enemiespgnote
end
end
end # DataManager
#==============================================================================
# ■ Game_Map
#------------------------------------------------------------------------------
# 管理地图的类。拥有卷动地图以及判断通行度的功能。
# 本类的实例请参考 $game_map 。
#==============================================================================
class Game_Map
#--------------------------------------------------------------------------
# ● 设置
#--------------------------------------------------------------------------
def setup(map_id)
@map_id = map_id
@map = load_data(sprintf("Data/Map%03d.rvdata2", @map_id))
#######################3
@map.add_mappgnote
#########################
@tileset_id = @map.tileset_id
@display_x = 0
@display_y = 0
referesh_vehicles
setup_events
setup_scroll
setup_parallax
setup_battleback
@need_refresh = false
end
end
#==============================================================================
# ■ RPG::BaseItem
#==============================================================================
class RPG::BaseItem
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :note
attr_accessor :features
#--------------------------------------------------------------------------
# new method: add_classespgnote
#--------------------------------------------------------------------------
def add_classespgnote
return if BASE_PGNOTE::BASE_CLASS_ID == 0
return if self == $data_classes[BASE_PGNOTE::BASE_CLASS_ID]
return if BASE_PGNOTE::NO_BASE_CLASS_ID.include?(self.id)
@note += $data_classes[BASE_PGNOTE::BASE_CLASS_ID].note.clone
################################
if BASE_PGNOTE::EDD_CLASSFE
@features += $data_classes[BASE_PGNOTE::BASE_CLASS_ID].features.clone
end
################################
end
#--------------------------------------------------------------------------
# new method: add_actorspgnote
#--------------------------------------------------------------------------
def add_actorspgnote
return if BASE_PGNOTE::BASE_ACTOR_ID == 0
return if self == $data_actors[BASE_PGNOTE::BASE_ACTOR_ID]
return if BASE_PGNOTE::NO_BASE_ACTOR_ID.include?(self.id)
@note += $data_actors[BASE_PGNOTE::BASE_ACTOR_ID].note.clone
end
#--------------------------------------------------------------------------
# new method: add_itemspgnote
#--------------------------------------------------------------------------
def add_itemspgnote
return if BASE_PGNOTE::BASE_ITEM_ID == 0
return if self == $data_items[BASE_PGNOTE::BASE_ITEM_ID]
return if BASE_PGNOTE::NO_BASE_ITEM_ID.include?(self.id)
@note += $data_items[BASE_PGNOTE::BASE_ITEM_ID].note.clone
end
#--------------------------------------------------------------------------
# new method: add_weaponspgnote
#--------------------------------------------------------------------------
def add_weaponspgnote
return if BASE_PGNOTE::BASE_WEAPON_ID == 0
return if self == $data_weapons[BASE_PGNOTE::BASE_WEAPON_ID]
return if BASE_PGNOTE::NO_BASE_WEAPON_ID.include?(self.id)
@note += $data_weapons[BASE_PGNOTE::BASE_WEAPON_ID].note.clone
end
#--------------------------------------------------------------------------
# new method: add_armorspgnote
#--------------------------------------------------------------------------
def add_armorspgnote
return if BASE_PGNOTE::BASE_ARMOR_ID == 0
return if self == $data_armors[BASE_PGNOTE::BASE_ARMOR_ID]
return if BASE_PGNOTE::NO_BASE_ARMOR_ID.include?(self.id)
@note += $data_armors[BASE_PGNOTE::BASE_ARMOR_ID].note.clone
end
#--------------------------------------------------------------------------
# new method: add_enemiespgnote
#--------------------------------------------------------------------------
def add_enemiespgnote
return if BASE_PGNOTE::BASE_EMENY_ID == 0
return if self == $data_enemies[BASE_PGNOTE::BASE_EMENY_ID]
return if BASE_PGNOTE::NO_BASE_EMENY_ID.include?(self.id)
@note += $data_enemies[BASE_PGNOTE::BASE_EMENY_ID].note.clone
end
end
#==============================================================================
# ■ RPG::Troop
#==============================================================================
class RPG::Map
#--------------------------------------------------------------------------
# public instance variables
#--------------------------------------------------------------------------
attr_accessor :note
#--------------------------------------------------------------------------
# new method: add_pages
#--------------------------------------------------------------------------
def add_mappgnote
return if BASE_PGNOTE::BASE_MAP_ID == 0
return if @map_id == BASE_PGNOTE::BASE_MAP_ID
return if BASE_PGNOTE::NO_BASE_MAP_ID.include?(@map_id)
@note += load_data(sprintf("Data/Map%03d.rvdata2", BASE_PGNOTE::BASE_MAP_ID)).note.clone
end
end
#==============================================================================
#
# ▼ End of File
#
#==============================================================================
复制代码
作者:
myownroc
时间:
2014-12-26 20:44
思路:将要备注的内容写在一个项目的备注栏里,然后再记录下相同备注的编号(可以新建一个项目记录编号,或者是写在同一个项目中)。
这个方法适用于相同类型的项目(比如备注的东西都是物品)。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1