|
//=============================================================================
// bcsj.js
//=============================================================================
/*:
* @plugindesc 保存相应物品
* @author wangwang
* @param i_id
* @desc 储存物品数据的变量
* @default 101
* @param w_id
* @desc 储存武器数据的变量
* @default 102
*@param a_id
* @desc 储存防具数据的变量
* @default 103
*/
(function() {
var parameters = PluginManager.parameters('bcsj');
var i_id = Number(parameters['i_id'] || 101);
var w_id = Number(parameters['w_id'] || 102);
var a_id = Number(parameters['a_id'] || 103);
var cc = [i_id,w_id,a_id]
//设置物品武器装备
set_i = function(id,xm,val){
if ($dataItems[id]){
$dataItems[id][xm]=val
return Set_itembase(id,0,xm,val)
}
return false
}
set_w = function(id,xm,val){
if ($dataWeapons[id]){
$dataWeapons[id][xm]=val
return Set_itembase(id,1,xm,val)
}
return false
}
set_a = function(id,xm,val){
if ($dataArmors[id]){
$dataArmors[id][xm]=val
return Set_itembase(id,2,xm,val)
}
return false
}
Set_itembase = function(id,type,xm,val){
var cc_id = cc[type];
if (!$gameVariables[cc_id]){$gameVariables[cc_id]=new Object()}
if ($gameVariables[cc_id][id]){
if(xm){$gameVariables[cc_id][id][xm] = val};
}else {
$gameVariables[cc_id][id]=new Object()
if(xm){$gameVariables[cc_id][id][xm] = val};
}
return true
}
var _DataManager_extractSaveContents =
DataManager.extractSaveContents;
DataManager.extractSaveContents = function(contents) {
_DataManager_extractSaveContents.call(this, contents);
if ($gameVariables[i_id]){
for (iid in $gameVariables[i_id]) {
for( xm in $gameVariables[i_id][iid]) {
if (xm =='damage'){
for (nr in $gameVariables[i_id][iid][xm]){
$dataItems[iid]['damage'][nr] = $gameVariables[i_id][iid][xm][nr]
}
}else if (xm == 'effects'){
for (nr1 in $gameVariables[i_id][iid][xm]){
$dataItems[iid][xm][nr1] = {code:0 , dataId: 0, value1:0,value2: 0 }
for (nr2 in $gameVariables[i_id][iid][xm][nr1]){
$dataItems[iid][xm][nr1][nr2] = $gameVariables[i_id][iid][xm][nr1][nr2]
}
}
}else {$dataItems[iid][xm] = $gameVariables[i_id][iid][xm]}
}
}
}
if ($gameVariables[a_id]){
for (iid in $gameVariables[a_id] ){
for( xm in $gameVariables[a_id][iid]) {
if (xm == 'params'){
for (nr in $gameVariables[a_id][iid][xm]){
$dataArmors[iid][xm][nr] = $gameVariables[a_id][iid][xm][nr]
}
}else if(xm == 'traits'){
for (nr1 in $gameVariables[a_id][iid][xm]){
$dataArmors[iid][xm][nr1] ={code: 0,dataId:0,value:0}
for(nr2 in $gameVariables[a_id][iid][xm][nr1]){
$dataArmors[iid][xm][nr1][nr2]=$gameVariables[a_id][iid][xm][nr1][nr2]
}
}
}else {$dataArmors[iid][xm] = $gameVariables[a_id][iid][xm]}
}
}
}
if ($gameVariables[w_id]){
for (iid in $gameVariables[w_id]){
for( xm in $gameVariables[w_id][iid]) {
if (xm == 'params'){
for (nr in $gameVariables[w_id][iid][xm]){
$dataWeapons[iid][xm][nr] = $gameVariables[w_id][iid][xm][nr]
}
}else if(xm == 'traits'){
for (nr1 in $gameVariables[w_id][iid][xm]){
$dataWeapons[iid][xm][nr1] ={code:0,dataId:0,value:0}
for(nr2 in $gameVariables[w_id][iid][xm][nr1]){
$dataWeapons[iid][xm][nr1][nr2]=$gameVariables[w_id][iid][xm][nr1][nr2]
}
}
}else {$dataWeapons[iid][xm]= $gameVariables[w_id][iid][xm]}
}
}
}
}
/* 胡写的..
DataManager.createGameObjects = function() {
//恢复基础数据
DataManager.loadDatabase
$gameTemp = new Game_Temp();
$gameSystem = new Game_System();
$gameScreen = new Game_Screen();
$gameTimer = new Game_Timer();
$gameMessage = new Game_Message();
$gameSwitches = new Game_Switches();
$gameVariables = new Game_Variables();
$gameSelfSwitches = new Game_SelfSwitches();
$gameActors = new Game_Actors();
$gameParty = new Game_Party();
$gameTroop = new Game_Troop();
$gameMap = new Game_Map();
$gamePlayer = new Game_Player();
};
*/
Game_Interpreter.prototype.command354 = function() {
SceneManager.goto(Scene_Boot);
return true;
};
Scene_GameEnd.prototype.commandToTitle = function() {
this.fadeOutAll();
SceneManager.goto(Scene_Boot);
};
//转到标题场景
Scene_Gameover.prototype.gotoTitle = function() {
SceneManager.goto(Scene_Boot);
};
})();
/*
//武器
//防具与武器 大致相同改成set_a 就好.. (wtypeId) 那里 不同
set_w(1,'name','巨剑') //名称
set_w(1,'description','这是巨剑的介绍')
set_w(1,'animationId', 5)//动画id
set_w(1,'wtypeId', 0)//武器类型 防具类型 atypeId 0开始
set_w(1,'etypeId', 1)//装备类型 武器默认1 防具 2 开始
set_w(1,'iconIndex ', 97)//图标id
set_w(1,'price', 100)//价格
set_w(1,'note', "注释")//注释
//参数是一个数组
//设置参数变更 (完全变更)
set_w(1,'params', [
100, //hp
200, //mp
300, //攻击
400, //防御
500, //m攻击
600, //m防御
700, //敏捷
800 //运气
])
//设置参数(部分)
canshu = $dataWeapons[1]['params']
canshu[1] = 100
set_w(1,'params', canshu)
//设置特性方法 特性是一个数组 ,包含的是对象
texing = $dataWeapons[1]['traits'] //获得特性数组 $dataArmors
texing[0] //第一个特性
//如果设置第一个特性
//结合数据库
texing[0].code = 11
//元素率11,减益率12,状态率14,状态拒绝15
//参数 21,额外参数22,特殊参数23
//攻击元素31 ,状态32,速度33,次数34
//添加技能类型41,封存技能类型42,添加技能43,封存技能44
//装备武器类型51,装备防具类型52,锁定装备53,封存装备54,装备槽类型55
//动作次数61,特殊标记62,崩塌效益63,队伍能力64
//选项
texing[0].dataId = 0
// 以下为开始值
//元素率1,减益率0,状态率1,状态拒绝1
//参数 0 额外参数0,特殊参数0
//攻击元素1 ,状态1,速度0,次数0
//添加技能类型1,封存技能类型1,添加技能1,封存技能1
//动作次数0,特殊标记0,崩塌效益0,队伍能力0
//数值
texing[0].value = 1 // 比例 ,数值 ,或 默认1
//添加一个特性对象
tx = {
code: 11,dataId:0,value:1
}
texing[texing.length]= tx
//设置特性
set_w(1,'traits', texing)
//物品
set_i(1,'animationId','41')//动画id
set_i(1,'consumable', true ) // //可消耗?
set_i(1,'hitType', 0 ) //打击类型 0开始
set_i(1,'description', "介绍" )
set_i(1,'iconIndex', 176) //图标id
set_i(1,'id', 1) //id
set_i(1,'itypeId', 1) //物品种类 1开始
set_i(1,'name', "药水") //名称
set_i(1,'note',"注释" )//注释
set_i(1,'scope', 0 )//范围 0开始
set_i(1,'speed', 0 )//速度
set_i(1,'repeats',1 ) //重复
set_i(1,'successRate',100 ) //成功率
set_i(1,'tpGain',0 )//tp获得
set_i(1,'occasion', 0) //场合 0开始
set_i(1,'price', 50) //价格
//设置伤害 伤害是一个对象.
shanghai = $dataItems[id]['damage'] //获得伤害
//要改哪个就设置哪个
shanghai.critical = false //是否暴击
shanghai.elementId = 0 //元素 -1开始
shanghai.formula ="0" //公式
shanghai.type = 0 //类型 0开始
shanghai.variance= 20 //变化
set_i(1,'damage', shanghai )
//创建新的伤害
sh = {critical:false, //是否暴击
elementId: 0 , //元素 -1开始
formula:"0" , //公式
type: 0 , //类型 0开始
variance: 20 , //变化
}
set_i(1,'damage', sh )
//设置效果 效果是一个数组
xiaoguo = $dataItems[id]['effects'] //获取效果数组
//设置一个效果
xiaoguo[0]//第一个效果
xiaoguo[0].code = 11
//恢复hp 11 mp 12 ,tp 13
//增加状态 21 消除状态 22
//31 添加增益效果 32 添加减益效果 33 删除增益效果 34 删除减益
//41 特殊效果 42 增长 43学习技能 44公共事件
xiaoguo[0].dataId= 0
//恢复hp mp tp 默认0
//增加状态 消除状态 0开始
// 添加增益效果 添加减益效果 删除增益效果 删除减益 0开始
// (特殊效果 默认 0) (增长 0 开始 )(学习技能种类 1开始 ) (公共事件 1 开始)
xiaoguo[0].value1= 0
//hp 比例 mp 比例 .tp 值
//增加状态 消除状态 比例
//(添加增益效果 场景段) ( 添加减益效果 场景段 ) (删除增益效果 删除减益值 默认为 1)
// (特殊效果 默认 1)(增长 值 ) ( 学习技能 公共事件默认 1 )
xiaoguo[0].value2= 0
//hp 值 mp 值
//之于的都默认 0
//添加一个效果
xg ={code: 21 , dataId: 0 , value1: 0.5 , value2: 0 }
xiaoguo[xiaoguo.length] = xg
set_i(1,'effects',xiaoguo)
*/
站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作
GMT+8, 2024-5-10 15:57
Powered by Discuz! X3.1
© 2001-2013 Comsenz Inc.