forked from triacontane/RPGMakerMV
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathChangeGameoverCondition.js
73 lines (65 loc) · 2.84 KB
/
ChangeGameoverCondition.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//=============================================================================
// ChangeGameOverCondition.js
// ----------------------------------------------------------------------------
// Copyright (c) 2015 Triacontane
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 1.1.0 2016/05/11 ゲームオーバーになるアクターIDを個別に指定できる機能を追加
// 1.0.0 2016/04/21 初版
// ----------------------------------------------------------------------------
// [Blog] : http://triacontane.blogspot.jp/
// [Twitter]: https://twitter.com/triacontane/
// [GitHub] : https://github.com/triacontane/
//=============================================================================
/*:
* @plugindesc ゲームオーバー条件変更プラグイン
* @author トリアコンタン
*
* @help ゲームオーバー条件をいずれかの味方が戦闘不能になった場合
* に変更します。
* 対象となるアクターIDを指定することもできます。
*
* 条件を変更するにはスクリプトで以下を実行してください。
*
* $gameParty.setVip(1); // アクターID[1]が戦闘不能になるとゲームオーバー
* $gameParty.setVipAll(); // いずれか一人のアクターが戦闘不能になるとゲームオーバー
* $gameParty.removeVip(); // ゲームオーバーの設定を解除
*
* このプラグインにはプラグインコマンドはありません。
*
* 利用規約:
* 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等)
* についても制限はありません。
* このプラグインはもうあなたのものです。
*/
(function () {
'use strict';
var _Game_Party_initialize = Game_Party.prototype.initialize;
Game_Party.prototype.initialize = function() {
_Game_Party_initialize.apply(this, arguments);
this._vipActor = null;
this._vipAll = true;
};
Game_Party.prototype.setVip = function(id) {
this._vipActor = id;
this._vipAll = false;
};
Game_Party.prototype.setVipAll = function() {
this._vipAll = true;
};
Game_Party.prototype.removeVip = function() {
this._vipActor = null;
this._vipAll = false;
};
var _Game_Party_isAllDead = Game_Party.prototype.isAllDead;
Game_Party.prototype.isAllDead = function() {
var result = _Game_Party_isAllDead.apply(this, arguments);
if (!result && this.deadMembers().length > 0 && (this.inBattle() || !this.isEmpty())) {
return this._vipAll ? true :
this._vipActor ? this.deadMembers().contains($gameActors.actor(this._vipActor)) : false;
}
return result;
};
})();