テント関連のソースコード のバックアップ(No.1)


Game_System.prototype.setTentObject = function() {

if(!$gameSystem.TentObjects){

var komomo = [2, 22, 21, 2];

var mimi   = [17, 24, 21, 2];

var settei = [12, 18,19, 2];

var bed    = [3, 20, 19, 2];

var mizu   = [7, 23, 19, 2];

var mesi   = [9, 24, 19, 2];

var syougou= [10, 28, 17, 2];

var zisseki= [14, 29, 17, 2];

var kakou  = [8, 22, 23, 2];

var evobj  = [39, 16, 14, 2];

$gameSystem.TentObjects = [komomo, mimi, settei, bed, mizu, mesi, syougou, zisseki, kakou, evobj];

}

 

if($gameSwitches.value(21)){

if(!this.TentmatchEventId(6)){

var ui = [6, 26, 21, 2];

$gameSystem.TentObjects.push(ui);

}

}

 

if($gameSwitches.value(24)){

if(!this.TentmatchEventId(5)){

var kuroe = [5, 28, 21, 2];

$gameSystem.TentObjects.push(kuroe);

}

}

 

this.setTentObject2();

};

 

Game_System.prototype.setTentObject2 = function() {

for (var i = 0; i < $gameMap.events().length; ++i) {

if(this.TentmatchEventId($gameMap.events()[i]._eventId)){

$gameMap.events()[i].locate($gameTemp.TentObjTemp[1], $gameTemp.TentObjTemp[2]);

$gameMap.events()[i].setDirection($gameTemp.TentObjTemp[3]);

}else{

var eid = $gameMap.events()[i]._eventId;

if(eid == 11 || eid == 13 || eid == 15 || eid == 16 || eid == 34 || eid == 35 || eid == 36 || eid == 37 || eid == 38 || eid == 4 || eid == 65 || eid == 66 || eid == 68 || eid == 69 || eid == 70 ||

 eid == 40 || eid == 41 || eid == 48 || eid == 49 || eid == 53 || eid == 54 || eid == 55 || eid == 56 || eid == 58 || eid == 59 || eid == 60 || eid == 63 || eid == 64 || eid == 75 || eid == 76||

 eid == 77 || eid == 78 || eid == 79 || eid == 80 || eid == 81 || eid == 82 || eid == 83){

$gameMap.events()[i].locate(0, 0);

}

}

}

};

 

Game_System.prototype.TentmatchEventId = function(id) {

for (var i = 0; i < $gameSystem.TentObjects.length; ++i) {

if(id == $gameSystem.TentObjects[i][0]){

$gameTemp.TentObjTemp = [$gameSystem.TentObjects[i][0], $gameSystem.TentObjects[i][1], $gameSystem.TentObjects[i][2], $gameSystem.TentObjects[i][3], i];

return true;

}

}

return false;

};

 

Game_System.prototype.callTentLayout = function() {

$gameSwitches.setValue(321, false);

$gameScreen.erasePicture(31);

SceneManager.push(Scene_TentLayout);

};

 
 

function Window_SetTentCommand() {

  this.initialize(...arguments);

}

 

Window_SetTentCommand.prototype = Object.create(Window_Command.prototype);

Window_SetTentCommand.prototype.constructor = Window_SetTentCommand;

 

Window_SetTentCommand.prototype.initialize = function(rect) {

  Window_Command.prototype.initialize.call(this, rect);

};

 

Window_SetTentCommand.prototype.makeCommandList = function() {

 

if($gameSystem.lastTentCateNo==null){

$gameSystem.lastTentCateNo = 0;

}

 

コメント:1人物 2施設 3加工台 4採集セット 5オブジェ

これとかも条件とか変えたら未開放でも開放みたいなん全然できると思われる

 

this.addCommand(224, 2, "御霊こもも", "set", true, 1);

this.addCommand(225, 17, "姫榊みみ", "set", true, 1);

if($gameSwitches.value(21)) this.addCommand(226, 6, "姫榊うい", "set", true, 1);

if($gameSwitches.value(24)) this.addCommand(227, 5, "魔王クロエ", "set", true, 1);

this.addCommand(228, 3, "ベッド", "set", true, 2);

this.addCommand(229, 7, "飲水台", "set", true, 2);

this.addCommand(230, 9, "食事台", "set", true, 2);

this.addCommand(231, 10, "称号台", "set", true, 2);

this.addCommand(232, 14, "実績台", "set", true, 2);

this.addCommand(233, 12, "設定台", "set", true, 2);

this.addCommand(234, 39, "イベント", "set", true, 2);

 

this.addCommand(96, 8, "風エリア加工台A", "set", true, 3);

if($gameSwitches.value(22)) this.addCommand(96, 11, "風エリア加工台B", "set", true, 3);

if($gameSwitches.value(27)) this.addCommand(97, 13, "風エリア加工台C", "set", true, 3);

 

if($gameSwitches.value(43)) this.addCommand(98, 15, "水エリア加工台A", "set", true, 3);

if($gameSwitches.value(44)) this.addCommand(99, 16, "水エリア加工台B", "set", true, 3);

 

if($gameSwitches.value(58)) this.addCommand(103, 34, "火エリア加工台A", "set", true, 3);

if($gameSwitches.value(59)) this.addCommand(104, 35, "火エリア加工台B", "set", true, 3);

 

if($gameSwitches.value(73)) this.addCommand(105, 36, "地エリア加工台A", "set", true, 3);

if($gameSwitches.value(74)) this.addCommand(106, 37, "地エリア加工台B", "set", true, 3);

if($gameSwitches.value(75)) this.addCommand(107, 38, "地エリア加工台C", "set", true, 3);

 

if($gameSwitches.value(326)) this.addCommand(236, 40, "風エリア採取系セット", "set", true, 4);

if($gameSwitches.value(327)) this.addCommand(237, 41, "水エリア採取系セット", "set", true, 4);

if($gameSwitches.value(328)) this.addCommand(238, 48, "火エリア採取系セット", "set", true, 4);

if($gameSwitches.value(329)) this.addCommand(239, 49, "地エリア採取系セット", "set", true, 4);

if($gameSwitches.value(365)) this.addCommand(253, 56, "地底前半採取系セット", "set", true, 4);

if($gameSwitches.value(384)) this.addCommand(298, 60, "地底後半採取系セット", "set", true, 4);

 

if($gameSwitches.value(584)) this.addCommand(463, 75, "天世界前半採取系セット", "set", true, 4);

if($gameSwitches.value(636)) this.addCommand(590, 79, "天世界中盤採取系セット", "set", true, 4);

 

if($gameSwitches.value(348)) this.addCommand(219, 53, "地底加工壺A", "set", true, 3);

if($gameSwitches.value(349)) this.addCommand(220, 54, "地底加工壺B", "set", true, 3);

if($gameSwitches.value(377)) this.addCommand(282, 59, "地底加工壺C", "set", true, 3);

if($gameSwitches.value(514)) this.addCommand(110, 63, "地底加工壺D", "set", true, 3);

 

if($gameSwitches.value(563)) this.addCommand(459, 69, "天の錬金A", "set", true, 3);

if($gameSwitches.value(564)) this.addCommand(460, 70, "天の錬金B", "set", true, 3);

if($gameSwitches.value(611)) this.addCommand(549, 77, "天の錬金C", "set", true, 3);

if($gameSwitches.value(612)) this.addCommand(550, 78, "天の錬金D", "set", true, 3);

 

if($gameSwitches.value(646)) this.addCommand(602, 82, "天の創造A", "set", true, 3);

if($gameSwitches.value(647)) this.addCommand(603, 83, "天の創造B", "set", true, 3);

 

if($gameSwitches.value(376)) this.addCommand(299, 58, "武器鉱炉", "set", true, 2);

if($gameSwitches.value(522)) this.addCommand(398, 65, "研究所", "set", true, 2);

if($gameSwitches.value(519)) this.addCommand(383, 64, "スクロールデスク", "set", true, 2);

if($gameSwitches.value(527)) this.addCommand(414, 66, "収益庫", "set", true, 5);

 

if($gameSwitches.value(637)) this.addCommand(592, 80, "緑共鳴", "set", true, 5);

if($gameSwitches.value(638)) this.addCommand(593, 81, "青共鳴", "set", true, 5);

 

if($gameSwitches.value(600)) this.addCommand(524, 76, "パワーの聖地ゲート", "set", true, 2);

if($gameSwitches.value(50)) this.addCommand(235, 4, "次元の穴", "set", true, 2);

if($gameSwitches.value(353)) this.addCommand(223, 55, "地底の穴", "set", true, 2);

if($gameSwitches.value(536)) this.addCommand(461, 68, "天世界の穴", "set", true, 2);

 

this.addCommand(15, 0, "配置全リセット", "reset", true, 0);

};

 

Window_SetTentCommand.prototype.cursorRight = function() {

if($gameSystem.lastTentCateNo!=null){

$gameSystem.lastTentCateNo += 1;

if($gameSystem.lastTentCateNo >= 6){

$gameSystem.lastTentCateNo = 0;

}

AudioManager.playSe({"name":"Cursor1","volume":90,"pitch":100,"pan":0});

this.refresh();

this.select(0);

this.reselect();

}

};

 

Window_SetTentCommand.prototype.cursorLeft = function() {

if($gameSystem.lastTentCateNo!=null){

$gameSystem.lastTentCateNo -= 1;

if($gameSystem.lastTentCateNo <= -1){

$gameSystem.lastTentCateNo = 5;

}

AudioManager.playSe({"name":"Cursor1","volume":90,"pitch":100,"pan":0});

this.refresh();

this.select(0);

this.reselect();

}

};

 

Window_SetTentCommand.prototype.addCommand = function(

  icon, eventId, name, symbol, enabled = true, ext = null

) {

if($gameSystem.lastTentCateNo==0){

this._list.push({ icon: icon, eventId: eventId, name: name, symbol: symbol, enabled: enabled, ext: ext, flagz: this.checkFlagz(eventId) });

return;

}

if(!ext){

this._list.push({ icon: icon, eventId: eventId, name: name, symbol: symbol, enabled: enabled, ext: ext, flagz: this.checkFlagz(eventId) });

}else{

if(ext == $gameSystem.lastTentCateNo){

this._list.push({ icon: icon, eventId: eventId, name: name, symbol: symbol, enabled: enabled, ext: ext, flagz: this.checkFlagz(eventId) });

}

}

  

};

 

Window_SetTentCommand.prototype.checkFlagz = function(eventId) {

  for (var i = 0; i < $gameSystem.TentObjects.length; ++i) {

  if($gameSystem.TentObjects[i][0]==eventId){

  return false;

  }

  }

  return true;

};

 

Window_SetTentCommand.prototype.commandIcon = function(index) {

  return this._list[index].icon;

};

 

Window_SetTentCommand.prototype.commandEventId = function(index) {

  return this._list[index].eventId;

};

 

Window_SetTentCommand.prototype.commandFlagz = function(index) {

  return this._list[index].flagz;

};

 

Window_SetTentCommand.prototype.drawItem = function(index) {

  const rect = this.itemLineRect(index);

  const align = this.itemTextAlign();

  this.resetTextColor();

  if(this._list[index].name == "配置全リセット"){

  this.changeTextColor(ColorManager.textColor(2));

  }

  this.changePaintOpacity(this.isCommandEnabled(index));

  this.drawIcon(this.commandIcon(index), rect.x, rect.y+2);

  this.drawText(this.commandName(index), rect.x+42, rect.y, rect.width, "left");

  var flag = 0;

  if(this.commandFlagz(index) && this.commandEventId(index)!= 0){

  this.drawText("未配置", rect.x, rect.y, rect.width, "right");

  }

};

 
 

function Scene_TentLayout() {

  this.initialize(...arguments);

}

 

Scene_TentLayout.prototype = Object.create(Scene_MenuBase.prototype);

Scene_TentLayout.prototype.constructor = Scene_TentLayout;

 

Scene_TentLayout.prototype.initialize = function() {

  Scene_MenuBase.prototype.initialize.call(this);

};

 

Scene_TentLayout.prototype.create = function() {

  Scene_MenuBase.prototype.create.call(this);

  this.createHelpWindow();

  this.createCommandWindow();

  this._helpWindow.setText("プレイヤーの向で前面配置を試みます! [←] [→] 表示種類変更");

};

 

Scene_TentLayout.prototype.createHelpWindow = function() {

  const rect = this.helpWindowRect();

  this._helpWindow = new Window_Help(rect);

  this.addWindow(this._helpWindow);

};

 

Scene_TentLayout.prototype.helpWindowRect = function() {

  const wx = 0;

  const wy = 0;

  const ww = Graphics.boxWidth;

  const wh = 56;

  return new Rectangle(wx, wy, ww, wh);

};

 

Scene_TentLayout.prototype.createCommandWindow = function() {

  const rect = this.commandWindowRect();

  this._commandWindow = new Window_SetTentCommand(rect);

  

  this._commandWindow.setHandler("cancel", this.popScene.bind(this));

  this._commandWindow.setHandler("set", this.set.bind(this));

  this._commandWindow.setHandler("reset", this.reset.bind(this));

  

  this.addWindow(this._commandWindow);

};

 

Scene_TentLayout.prototype.commandWindowRect = function() {

  const wx = 0;

  const wy = this._helpWindow.height;

  const ww = Graphics.boxWidth;

  const wh = Graphics.boxHeight - this._helpWindow.height;

  return new Rectangle(wx, wy, ww, wh);

};

 
 

Scene_TentLayout.prototype.set = function() {

var px = $gamePlayer.x;

var py = $gamePlayer.y;

var sx = 0;

var sy = 0;

var pd = 0;

 

if($gamePlayer._direction == 8){

sx = px;

sy = py - 1;

pd = 8;

}

else if($gamePlayer._direction == 6){

sx = px + 1;

sy = py;

pd = 6;

}

else if($gamePlayer._direction == 2){

sx = px;

sy = py + 1;

pd = 2;

}

else if($gamePlayer._direction == 4){

sx = px - 1;

sy = py;

pd = 4;

}

 

if($gameMap.eventIdXy(sx, sy) == 0 && $gameMap.regionId(sx, sy) == 251){

AudioManager.playSe({"name":"Flash1","volume":100,"pitch":100,"pan":0});

 

var eventId = this._commandWindow._list[this._commandWindow.index()].eventId;

if($gameSystem.TentmatchEventId(eventId)){

$gameSystem.TentObjects[$gameTemp.TentObjTemp[4]][1] = sx;

$gameSystem.TentObjects[$gameTemp.TentObjTemp[4]][2] = sy;

 

if(eventId == 2 || eventId == 17 || eventId == 6 || eventId == 5){

$gameSystem.TentObjects[$gameTemp.TentObjTemp[4]][3] = pd;

}else{

$gameSystem.TentObjects[$gameTemp.TentObjTemp[4]][3] = 2;

}

 

$gameSystem.setTentObject2();

}else{

if(eventId == 2 || eventId == 17 || eventId == 6 || eventId == 5){

var a = [eventId, sx, sy, pd];

}else{

var a = [eventId, sx, sy, 2];

}

 

$gameSystem.TentObjects.push(a);

$gameSystem.setTentObject2();

}

 

}else{

AudioManager.playSe({"name":"Buzzer1","volume":100,"pitch":100,"pan":0});

}

this.popScene();

};

 

Scene_TentLayout.prototype.reset = function() {

var komomo = [2, 22, 21, 2];

var mimi   = [17, 24, 21, 2];

var settei = [12, 18,19, 2];

var bed    = [3, 20, 19, 2];

var mizu   = [7, 23, 19, 2];

var mesi   = [9, 24, 19, 2];

var syougou= [10, 28, 17, 2];

var zisseki= [14, 29, 17, 2];

var kakou  = [8, 22, 23, 2];

var evobj  = [39, 16, 14, 2];

$gameSystem.TentObjects[0] = komomo;

$gameSystem.TentObjects[1] = mimi;

$gameSystem.TentObjects[2] = settei;

$gameSystem.TentObjects[3] = bed;

$gameSystem.TentObjects[4] = mizu;

$gameSystem.TentObjects[5] = mesi;

$gameSystem.TentObjects[6] = syougou;

$gameSystem.TentObjects[7] = zisseki;

$gameSystem.TentObjects[8] = kakou;

$gameSystem.TentObjects[9] = evobj;

 

if($gameSwitches.value(21)){

if(!$gameSystem.TentmatchEventId(6)){

var ui = [6, 26, 21, 2];

$gameSystem.TentObjects.push(ui);

}else{

$gameSystem.TentObjects[$gameTemp.TentObjTemp[4]] = [6, 26, 21, 2];

}

}

 

if($gameSwitches.value(24)){

if(!$gameSystem.TentmatchEventId(5)){

var kuroe = [5, 28, 21, 2];

$gameSystem.TentObjects.push(kuroe);

}else{

$gameSystem.TentObjects[$gameTemp.TentObjTemp[4]] = [5, 28, 21, 2];

}

}

 

if($gameSwitches.value(22)){

if($gameSystem.TentmatchEventId(11)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(27)){

if($gameSystem.TentmatchEventId(13)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(43)){

if($gameSystem.TentmatchEventId(15)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(44)){

if($gameSystem.TentmatchEventId(16)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(58)){

if($gameSystem.TentmatchEventId(34)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(59)){

if($gameSystem.TentmatchEventId(35)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(73)){

if($gameSystem.TentmatchEventId(36)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(74)){

if($gameSystem.TentmatchEventId(37)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(75)){

if($gameSystem.TentmatchEventId(38)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(50)){

if($gameSystem.TentmatchEventId(4)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

if($gameSwitches.value(326)){

if($gameSystem.TentmatchEventId(40)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(327)){

if($gameSystem.TentmatchEventId(41)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(328)){

if($gameSystem.TentmatchEventId(48)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(329)){

if($gameSystem.TentmatchEventId(49)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

if($gameSwitches.value(348)){

if($gameSystem.TentmatchEventId(53)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(349)){

if($gameSystem.TentmatchEventId(54)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(353)){

if($gameSystem.TentmatchEventId(55)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(365)){

if($gameSystem.TentmatchEventId(56)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

if($gameSwitches.value(376)){

if($gameSystem.TentmatchEventId(58)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

if($gameSwitches.value(377)){

if($gameSystem.TentmatchEventId(59)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

if($gameSwitches.value(384)){

if($gameSystem.TentmatchEventId(60)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

if($gameSwitches.value(514)){

if($gameSystem.TentmatchEventId(63)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

if($gameSwitches.value(519)){

if($gameSystem.TentmatchEventId(64)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

if($gameSwitches.value(522)){

if($gameSystem.TentmatchEventId(65)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

if($gameSwitches.value(527)){

if($gameSystem.TentmatchEventId(66)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

if($gameSwitches.value(536)){

if($gameSystem.TentmatchEventId(68)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(563)){

if($gameSystem.TentmatchEventId(69)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(564)){

if($gameSystem.TentmatchEventId(70)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(584)){

if($gameSystem.TentmatchEventId(75)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(600)){

if($gameSystem.TentmatchEventId(76)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

if($gameSwitches.value(611)){

if($gameSystem.TentmatchEventId(77)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(612)){

if($gameSystem.TentmatchEventId(78)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(636)){

if($gameSystem.TentmatchEventId(79)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(637)){

if($gameSystem.TentmatchEventId(80)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(638)){

if($gameSystem.TentmatchEventId(81)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

if($gameSwitches.value(646)){

if($gameSystem.TentmatchEventId(82)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

if($gameSwitches.value(647)){

if($gameSystem.TentmatchEventId(83)){

$gameSystem.TentObjects.splice($gameTemp.TentObjTemp[4], 1);

 

}

}

 

var params = [0, 4, 25, 24, 8, 0];

$gameMap._interpreter.command201(params);

$gameSystem.setTentObject2();

AudioManager.playSe({"name":"Flash1","volume":100,"pitch":100,"pan":0});

this.popScene();

};