Hey there 🙂
I've got a quick question: Does anyone know if this is compatible with mobile games?
I've got a quick question: Does anyone know if this is compatible with mobile games?
<Custom Apply Effect>
user._prevCharName = user._prevCharName || user._characterName;
user._prevCharIndex = user._prevCharIndex || user._characterIndex;
user.setCharacterImage("Nature9", 1);
$gamePlayer.refresh()
</Custom Apply Effect>
<Custom Remove Effect>
var charName = user._prevCharName;
var charIndex = user._prevCharIndex;
user.setCharacterImage(charName, charIndex);
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
$gamePlayer.refresh()
</Custom Remove Effect>
<After Eval>
user.addState(329);
</After Eval>
try using yanfly's counter control:
BattleManagerTBS.processCounterAttack = function (targets, subject, action) {
if (!action) return;
this.setCursorCell(subject.getCell());
targets.forEach(function (entity) {
if (entity) {
var dist = LeUtilities.distanceBetweenCells(subject.getCell(), entity.getCell());
if (dist <= 1 && Math.random() < action.itemCnt(entity.battler()) && !entity._counters) { //Cellbind modified
var skill = $dataSkills[entity.battler().attackSkillId()];
subject.battler().clearResult();
entity.battler().clearResult(); //Cellbind added
entity.lookAt(subject.getCell());
entity.addTextPopup("Counter");
entity.startSequence("counter");
entity._counters = true; //Cellbind added
this.forceAction(skill, entity);
}
}
}.bind(this));
};
BattleManagerTBS.forceAction = function (obj, entity) {
var battler = entity.battler();
var center = entity.getCell().toCoords();
var action = new TBS_FloatingAction(battler, false);
action.setItemObject(obj);
entity.battler()._itemOnUse = obj;
var data = obj.id === battler.attackSkillId() ? entity.getAttackScopeData() : entity.getObjectScopeData(obj);
this.makeActionScope(entity, data, obj);
var aoeData = obj.id === battler.attackSkillId() ? entity.getAttackAoEData() : entity.getObjectAoEData(obj);
var aoeCenter = this._activeCell.toCoords();
var param = this.makeObjAoEParam(obj, entity, aoeCenter);
var aoe = this.getScopeFromData(aoeData, aoeCenter, param);
this._actionAoE = aoe;
var item = action.item();
var id = action.isAttack() ? entity.getWeaponSequenceData() : entity.getObjectSequenceData(item);
battler.useItem(item);
action.applyGlobal();
this._activeAction = action; //Cellbind added
entity.lookAt(this._activeCell);
entity.appendSequence(id, action);
};
TBSEntity.prototype.initialize = function (battler, layer) {
this._battler = battler;
this._counters = false; //Cellbind added
this._cell = null;
this._cellX = 0;
this._cellY = 0;
this._moving = false;
this._movePoints = 0;
this._movingDistance = [0, 0];
this._movePath = [];
this._movingNextCell = null;
this._moveReducePoints = false;
this._movePerformed = false;
this._actionPerformed = false;
this._dead = false;
this._flag = null;
this._isMouseOver = false;
this._turnHidden = false;
this.createSprite(battler, layer);
this.createSpriteValues();
this.createComponents();
this.setMovePoints();
this.initializeSpeed();
};
TBSEntity.prototype.onTurnEnd = function () {
this._battler.onTurnEnd();
this.addPopup();
this._battler.clearResult();
this.setMovePoints();
this._turnPlayed = true;
this._movePerformed = false;
this._actionPerformed = false;
this._counters = false; //Cellbind added
};
Original thread: https://forums.rpgmakerweb.com/threads/lecode-tactical-battle-system-0-77-2b.71572/