Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============================================================================
- //LudoSkillCount.js
- //=============================================================================
- /*:
- * @plugindesc Counts the amount of times a skill has been used in a single battle, and over the course of the game.
- * @author Alessio De Santis
- *
- *
- * @help
- * Access the values by using script commands.
- * $skillCount[skillId].battle for the amounts of times used in a battle (value is saved until next battle)
- * $skillCount[skillId].total for the total amounts of times used in all battles.
- */
- //-----------------------------------------------------------------------------
- $skillCount = [];
- Scene_Battle.prototype.start = function() {
- Scene_Base.prototype.start.call(this);
- this.startFadeIn(this.fadeSpeed(), false);
- BattleManager.playBattleBgm();
- BattleManager.startBattle();
- };
- BattleManager.startBattle = function() {
- this._phase = 'start';
- $gameSystem.onBattleStart();
- $gameParty.onBattleStart();
- $gameTroop.onBattleStart();
- this.displayStartMessages();
- };
- BattleManager.startAction = function() {
- var subject = this._subject;
- var action = subject.currentAction();
- var targets = action.makeTargets();
- this._phase = 'action';
- this._action = action;
- this._targets = targets;
- subject.useItem(action.item());
- this.increment(action.item().id);
- this._action.applyGlobal();
- this.refreshStatus();
- this._logWindow.startAction(subject, action, targets);
- };
- Scene_Title.prototype.create = function() {
- Scene_Base.prototype.create.call(this);
- this.createBackground();
- this.createForeground();
- this.createWindowLayer();
- this.createCommandWindow();
- this.initSC();
- };
- BattleManager.increment = function(id) {
- if(id != 0){
- $skillCount[id-1].battle++;
- $skillCount[id-1].total++;
- }
- }
- BattleManager.resetSC = function() {
- for(i of $skillCount){
- i.battle = 0;
- }
- }
- Scene_Title.prototype.initSC = function(){
- var temp = $dataSkills;
- for(i of temp){
- for(j in i){
- if (j == "name") {
- for(k of $skillCount) {
- if(k.name == i[j]){
- return console.log($skillCount);
- }
- }
- $skillCount.push({
- name : i[j],
- battle : 0,
- total : 0,
- });
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement