Initialize local project and fix ranch growth synchronization
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
import flash.geom.Rectangle;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class BaseBattleArea
|
||||
{
|
||||
|
||||
public var id:String;
|
||||
|
||||
public var type:String;
|
||||
|
||||
public var para:Object;
|
||||
|
||||
public var rec:Rectangle;
|
||||
|
||||
public var cooldown:Cooldowner;
|
||||
|
||||
public function BaseBattleArea()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function buildByObject(obj:Object) : void
|
||||
{
|
||||
this.id = obj.id;
|
||||
this.type = obj.type;
|
||||
this.para = obj.para;
|
||||
this.rec = new Rectangle(obj.x,obj.y,obj.w,obj.h);
|
||||
init();
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
if(cooldown != null)
|
||||
{
|
||||
cooldown.pause();
|
||||
}
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
if(cooldown != null)
|
||||
{
|
||||
cooldown.resume();
|
||||
}
|
||||
}
|
||||
|
||||
public function autoMon(mon:BattleMon) : void
|
||||
{
|
||||
if(rec.contains(mon.x,mon.y))
|
||||
{
|
||||
activity(mon);
|
||||
}
|
||||
}
|
||||
|
||||
public function activity(mon:BattleMon) : void
|
||||
{
|
||||
}
|
||||
|
||||
public function cd() : Boolean
|
||||
{
|
||||
if(cooldown == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return cooldown.cooldown;
|
||||
}
|
||||
|
||||
public function activitycd() : void
|
||||
{
|
||||
if(cooldown == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
cooldown.activity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
import net.pixvi.pfw.utils.ObjectUtil;
|
||||
import net.pixvi.pfw.utils.json.Json;
|
||||
|
||||
public class BattleData
|
||||
{
|
||||
|
||||
public var battlePosition:BattlePosition;
|
||||
|
||||
public var win:Boolean;
|
||||
|
||||
private var _cheatNum:int = 0;
|
||||
|
||||
public var cheatRecords:CheatRecord;
|
||||
|
||||
public var killMonster:Object;
|
||||
|
||||
public var leftTime:int;
|
||||
|
||||
public var killNum:int;
|
||||
|
||||
public var totalDamage:int;
|
||||
|
||||
public var bossDamage:int;
|
||||
|
||||
public var deadNum:int;
|
||||
|
||||
public var aliveNum:int;
|
||||
|
||||
public var apLeft:int;
|
||||
|
||||
public var battleMonIds:Array;
|
||||
|
||||
public function BattleData()
|
||||
{
|
||||
super();
|
||||
cheatRecords = new CheatRecord();
|
||||
}
|
||||
|
||||
public function get cheatNum() : int
|
||||
{
|
||||
return _cheatNum;
|
||||
}
|
||||
|
||||
public function set cheatNum(value:int) : void
|
||||
{
|
||||
_cheatNum = value;
|
||||
}
|
||||
|
||||
public function getObj() : Object
|
||||
{
|
||||
var obj:Object = ObjectUtil.deepClone(this);
|
||||
if(cheatNum > 0)
|
||||
{
|
||||
obj.cheatRecords = Json.encode(obj.cheatRecords);
|
||||
}
|
||||
else
|
||||
{
|
||||
obj.cheatRecords = "";
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
public class BattleFieldVo
|
||||
{
|
||||
|
||||
public var mapObjects:Array = [];
|
||||
|
||||
public var mapPoints:Array = [];
|
||||
|
||||
public var mapAreas:Array = [];
|
||||
|
||||
public var fieldName:String = "default";
|
||||
|
||||
public var fieldMode:Boolean = true;
|
||||
|
||||
public function BattleFieldVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,576 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.battle.BattleModeType;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.mon.MonsterVo;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.myr.view.attack.BaseAttack;
|
||||
import net.pixvi.myr.view.attack.type.AttackType;
|
||||
import net.pixvi.pfw.utils.Mapper;
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
|
||||
public class BattleMonVo
|
||||
{
|
||||
|
||||
public var monsterVo:MonsterVo;
|
||||
|
||||
public var attack:BaseAttack;
|
||||
|
||||
public var ai:int = 0;
|
||||
|
||||
public var ai_search:int = 2;
|
||||
|
||||
public var from:String = "stage";
|
||||
|
||||
public var hpMax:int;
|
||||
|
||||
public var spd_mov:Number = -1;
|
||||
|
||||
public var spd_atk:Number = -1;
|
||||
|
||||
public var spd_atk_add:Number = 0;
|
||||
|
||||
public var atk_dis:Number = -1;
|
||||
|
||||
public var defDama:Number = 0;
|
||||
|
||||
private var _selfCure:PointLocker = new PointLocker();
|
||||
|
||||
private var _atkVim:PointLocker = new PointLocker();
|
||||
|
||||
private var _atkStun:PointLocker = new PointLocker();
|
||||
|
||||
public var atkStunTime:int = 0;
|
||||
|
||||
public var atkStunType:int = 1;
|
||||
|
||||
private var _defStun:PointLocker = new PointLocker();
|
||||
|
||||
public var defStunTime:int = 0;
|
||||
|
||||
public var defStunType:int = 1;
|
||||
|
||||
private var _atkPoi:PointLocker = new PointLocker();
|
||||
|
||||
private var _atkPoiDmg:PointLocker = new PointLocker();
|
||||
|
||||
public var atkPoiType:int = 1;
|
||||
|
||||
public var powDefPercent:Number = 0;
|
||||
|
||||
public var immuDebuff:Boolean = false;
|
||||
|
||||
public var skillCooldown:Number = 0;
|
||||
|
||||
private var _sunFire:PointLocker = new PointLocker();
|
||||
|
||||
private var _moonHeal:PointLocker = new PointLocker();
|
||||
|
||||
private var _deadBoom:PointLocker = new PointLocker();
|
||||
|
||||
private var _thorns:PointLocker = new PointLocker();
|
||||
|
||||
private var _apCostSave:PointLocker = new PointLocker();
|
||||
|
||||
public var pow:Number;
|
||||
|
||||
public var powdef:Number;
|
||||
|
||||
public var level:int;
|
||||
|
||||
public var type:int;
|
||||
|
||||
public var mode:int;
|
||||
|
||||
private var _atk:PointLocker = new PointLocker();
|
||||
|
||||
private var _def:PointLocker = new PointLocker();
|
||||
|
||||
private var _hp:PointLocker = new PointLocker();
|
||||
|
||||
private var _dex:PointLocker = new PointLocker();
|
||||
|
||||
public var crit:Number = 0;
|
||||
|
||||
public var dead:Boolean = false;
|
||||
|
||||
public var apCost:int = 0;
|
||||
|
||||
public var name:String;
|
||||
|
||||
public var element:int = 0;
|
||||
|
||||
private var dataobj:Object;
|
||||
|
||||
public var mid:Number;
|
||||
|
||||
public var buffImmune:Boolean = false;
|
||||
|
||||
public var moveImmune:Boolean = false;
|
||||
|
||||
public var controlImmune:Boolean = false;
|
||||
|
||||
public var countUnit:Boolean = true;
|
||||
|
||||
public var protectTarget:Boolean = false;
|
||||
|
||||
public var destroyTarget:Boolean = false;
|
||||
|
||||
public var summonUnit:Boolean = false;
|
||||
|
||||
public var skill_1:int = -1;
|
||||
|
||||
public var skill_1_lv:int = -1;
|
||||
|
||||
public var skill_1_chance:Number = -1;
|
||||
|
||||
public var skill_2:int = -1;
|
||||
|
||||
public var skill_2_lv:int = -1;
|
||||
|
||||
public var skill_2_chance:Number = -1;
|
||||
|
||||
public var joinPoint:String = "";
|
||||
|
||||
public var joinTime:int = -1;
|
||||
|
||||
public var controller:Array;
|
||||
|
||||
public var teamPos:int;
|
||||
|
||||
public var leader:Boolean;
|
||||
|
||||
public var team:int = 2;
|
||||
|
||||
public var isObject:Boolean = false;
|
||||
|
||||
public var zl:int = 0;
|
||||
|
||||
public var setOScale:Number;
|
||||
|
||||
public var wave:int = 1;
|
||||
|
||||
public var joinAction:String = "auto";
|
||||
|
||||
public var autoTarget:Boolean = true;
|
||||
|
||||
public var equips:Array = [];
|
||||
|
||||
public var attackArea:String = "";
|
||||
|
||||
public var apRecovery:Boolean = false;
|
||||
|
||||
public var bossPoint:int = 0;
|
||||
|
||||
public var abilityScaled:Boolean = false;
|
||||
|
||||
public function BattleMonVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function get selfCure() : Number
|
||||
{
|
||||
return _selfCure.val;
|
||||
}
|
||||
|
||||
public function set selfCure(value:Number) : void
|
||||
{
|
||||
_selfCure.val = value;
|
||||
}
|
||||
|
||||
public function get atkVim() : Number
|
||||
{
|
||||
return _atkVim.val;
|
||||
}
|
||||
|
||||
public function set atkVim(value:Number) : void
|
||||
{
|
||||
_atkVim.val = value;
|
||||
}
|
||||
|
||||
public function get atkStun() : Number
|
||||
{
|
||||
return _atkStun.val;
|
||||
}
|
||||
|
||||
public function set atkStun(value:Number) : void
|
||||
{
|
||||
_atkStun.val = value;
|
||||
}
|
||||
|
||||
public function get defStun() : Number
|
||||
{
|
||||
return _defStun.val;
|
||||
}
|
||||
|
||||
public function set defStun(value:Number) : void
|
||||
{
|
||||
_defStun.val = value;
|
||||
}
|
||||
|
||||
public function get atkPoi() : Number
|
||||
{
|
||||
return _atkPoi.val;
|
||||
}
|
||||
|
||||
public function set atkPoi(value:Number) : void
|
||||
{
|
||||
_atkPoi.val = value;
|
||||
}
|
||||
|
||||
public function get atkPoiDmg() : int
|
||||
{
|
||||
return _atkPoiDmg.val;
|
||||
}
|
||||
|
||||
public function set atkPoiDmg(value:int) : void
|
||||
{
|
||||
_atkPoiDmg.val = value;
|
||||
}
|
||||
|
||||
public function get sunFire() : int
|
||||
{
|
||||
return _sunFire.val;
|
||||
}
|
||||
|
||||
public function set sunFire(value:int) : void
|
||||
{
|
||||
_sunFire.val = value;
|
||||
}
|
||||
|
||||
public function get moonHeal() : int
|
||||
{
|
||||
return _moonHeal.val;
|
||||
}
|
||||
|
||||
public function set moonHeal(value:int) : void
|
||||
{
|
||||
_moonHeal.val = value;
|
||||
}
|
||||
|
||||
public function get deadBoom() : int
|
||||
{
|
||||
return _deadBoom.val;
|
||||
}
|
||||
|
||||
public function set deadBoom(value:int) : void
|
||||
{
|
||||
_deadBoom.val = value;
|
||||
}
|
||||
|
||||
public function get thorns() : int
|
||||
{
|
||||
return _thorns.val;
|
||||
}
|
||||
|
||||
public function set thorns(value:int) : void
|
||||
{
|
||||
_thorns.val = value;
|
||||
}
|
||||
|
||||
public function get dex() : int
|
||||
{
|
||||
return _dex.val;
|
||||
}
|
||||
|
||||
public function set dex(value:int) : void
|
||||
{
|
||||
_dex.val = value;
|
||||
}
|
||||
|
||||
public function get def() : int
|
||||
{
|
||||
return _def.val;
|
||||
}
|
||||
|
||||
public function set def(value:int) : void
|
||||
{
|
||||
_def.val = value;
|
||||
}
|
||||
|
||||
public function get atk() : int
|
||||
{
|
||||
return _atk.val;
|
||||
}
|
||||
|
||||
public function set atk(value:int) : void
|
||||
{
|
||||
_atk.val = value;
|
||||
}
|
||||
|
||||
public function buildByMonster(mon:MonsterVo) : void
|
||||
{
|
||||
monsterVo = mon;
|
||||
attack = AttackType.getAttack(monsterVo.atk_type.toString());
|
||||
if(atk_dis == -1)
|
||||
{
|
||||
atk_dis = monsterVo.atk_dis;
|
||||
}
|
||||
if(spd_mov == -1)
|
||||
{
|
||||
spd_mov = monsterVo.spd_move + GameMath.addMovSpdByDex(monsterVo.dex);
|
||||
}
|
||||
if(spd_atk == -1)
|
||||
{
|
||||
spd_atk = monsterVo.spd_atk + GameMath.addAtkSpdByDex(monsterVo.dex);
|
||||
}
|
||||
if(mon.upStar > 0)
|
||||
{
|
||||
skill_1 = mon.skill_1;
|
||||
skill_2 = mon.skill_2;
|
||||
}
|
||||
spd_atk -= 1600 * monsterVo.allAdd("atkSpd") / 100;
|
||||
this.apCost = monsterVo.ap_cost - monsterVo.allAdd("apCostSave");
|
||||
if(this.apCost < 0)
|
||||
{
|
||||
this.apCost = 0;
|
||||
}
|
||||
this.atk = monsterVo.atk;
|
||||
this.def = monsterVo.def;
|
||||
this.dex = monsterVo.dex;
|
||||
this.hpMax = this.hp = monsterVo.hp;
|
||||
this.deadBoom = monsterVo.allAdd("deadBoom");
|
||||
this.level = monsterVo.level;
|
||||
this.mode = monsterVo.mode;
|
||||
this.type = monsterVo.type;
|
||||
this.name = monsterVo.name;
|
||||
this.mid = monsterVo.id;
|
||||
pow = monsterVo.pow + GameMath.addPowByAtk(monsterVo.atk);
|
||||
powdef = monsterVo.powdef + GameMath.addPowDefByHp(monsterVo.hp);
|
||||
zl = GameMath.zl_battleMonVo(this);
|
||||
}
|
||||
|
||||
public function buildSpecialByMonster(monVo:MonsterVo) : void
|
||||
{
|
||||
crit = monsterVo.allAdd("crit");
|
||||
selfCure = monsterVo.allAdd("selfCure");
|
||||
atkVim = monsterVo.allAdd("atkVim");
|
||||
atkStun = monsterVo.allAdd("atkStun");
|
||||
atkStunTime = 2;
|
||||
atkStunType = monsterVo.equipType("atkStun","atkStunType");
|
||||
defStun = monsterVo.allAdd("defStun");
|
||||
defStunTime = 2;
|
||||
defStunType = monsterVo.equipType("defStun","defStunType");
|
||||
atkPoi = monsterVo.allAdd("atkPoi");
|
||||
atkPoiDmg = monsterVo.allAdd("atkPoiDmg");
|
||||
atkPoiType = monsterVo.equipType("atkPoi","atkPoiType");
|
||||
skillCooldown = monsterVo.allAdd("skillCooldown");
|
||||
sunFire = monsterVo.allAdd("sunFire");
|
||||
moonHeal = monsterVo.allAdd("moonHeal");
|
||||
thorns = monsterVo.allAdd("thorns");
|
||||
var spWords:Array = monsterVo.getAllSpWord();
|
||||
for each(var spWord:String in spWords)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public function clone(changeMode:int = -1, changeType:int = -1) : BattleMonVo
|
||||
{
|
||||
var vo:BattleMonVo = new BattleMonVo();
|
||||
var monvo:MonsterVo = this.monsterVo.clone();
|
||||
if(changeMode != -1)
|
||||
{
|
||||
monvo.mode = changeMode;
|
||||
}
|
||||
if(changeType != -1)
|
||||
{
|
||||
monvo.skin = 0;
|
||||
monvo.type = changeType;
|
||||
}
|
||||
vo.buildByMonster(monvo);
|
||||
vo.hp = this.hp;
|
||||
vo.hpMax = this.hpMax;
|
||||
vo.ai = this.ai;
|
||||
vo.ai_search = this.ai_search;
|
||||
if(this.apCost < vo.apCost)
|
||||
{
|
||||
vo.apCost = this.apCost;
|
||||
}
|
||||
vo.atk = this.atk;
|
||||
vo.atk_dis = this.atk_dis;
|
||||
vo.crit = this.crit;
|
||||
vo.def = this.def;
|
||||
vo.dex = this.dex;
|
||||
vo.level = this.level;
|
||||
vo.summonUnit = true;
|
||||
vo.setOScale = this.setOScale;
|
||||
return vo;
|
||||
}
|
||||
|
||||
public function buildByObject(o:Object, scaleAbility:Number = 1, scaleHp:Number = 1) : void
|
||||
{
|
||||
var mon:MonsterVo = null;
|
||||
dataobj = o;
|
||||
Mapper.fillVariables(this,o);
|
||||
if(o.powDefPercent != null && o.powDefPercent > 0)
|
||||
{
|
||||
powDefPercent = o.powDefPercent;
|
||||
}
|
||||
if(o.autoValue == true)
|
||||
{
|
||||
mon = new MonsterVo();
|
||||
monsterVo = mon;
|
||||
mon.init(o.type);
|
||||
mon.buildByArea();
|
||||
mon.level = o.level;
|
||||
mon.setLocalMode(o.mode);
|
||||
buildByMonster(mon);
|
||||
if(o.nicname == "" || o.nicname == null)
|
||||
{
|
||||
this.name = mon.name;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.name = o.nicname;
|
||||
}
|
||||
this.crit += o.crit;
|
||||
}
|
||||
else
|
||||
{
|
||||
monsterVo = new MonsterVo(type);
|
||||
monsterVo.setLocalMode(this.mode);
|
||||
attack = AttackType.getAttack(monsterVo.atk_type.toString());
|
||||
pow = monsterVo.pow;
|
||||
if(o.nicname == "" || o.nicname == null)
|
||||
{
|
||||
this.name = monsterVo.name;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.name = o.nicname;
|
||||
}
|
||||
powdef = monsterVo.powdef;
|
||||
crit = o.crit;
|
||||
zl = GameMath.zl_battleMonVo(this);
|
||||
}
|
||||
this.apCost = monsterVo.ap_cost - this.apCostSave;
|
||||
if(this.apCost < 0)
|
||||
{
|
||||
this.apCost = 0;
|
||||
}
|
||||
if(o.ornaments != null)
|
||||
{
|
||||
equips = o.ornaments;
|
||||
}
|
||||
if(o.apRecovery != null)
|
||||
{
|
||||
apRecovery = o.apRecovery;
|
||||
}
|
||||
if(o.bossPoint != null)
|
||||
{
|
||||
bossPoint = o.bossPoint;
|
||||
}
|
||||
if(!abilityScaled)
|
||||
{
|
||||
if(scaleAbility != 1 || scaleHp != 1)
|
||||
{
|
||||
this.atk *= scaleAbility;
|
||||
this.def *= scaleAbility;
|
||||
this.dex *= scaleAbility;
|
||||
this.deadBoom *= scaleAbility;
|
||||
this.sunFire *= scaleAbility;
|
||||
this.moonHeal *= scaleAbility;
|
||||
this.thorns *= scaleAbility;
|
||||
this.selfCure *= scaleAbility;
|
||||
this.level *= scaleAbility;
|
||||
for each(var c:Object in controller)
|
||||
{
|
||||
if(c.type == "hp")
|
||||
{
|
||||
c.para.hp *= scaleAbility;
|
||||
}
|
||||
else if(c.type == "deadBoom")
|
||||
{
|
||||
c.para.atk *= scaleAbility;
|
||||
}
|
||||
else if(c.type == "monMaker")
|
||||
{
|
||||
if(c.para.hp != null)
|
||||
{
|
||||
c.para.hp *= scaleHp;
|
||||
}
|
||||
if(c.para.hpMax != null)
|
||||
{
|
||||
c.para.hpMax *= scaleHp;
|
||||
}
|
||||
if(c.para.atk != null)
|
||||
{
|
||||
c.para.atk *= scaleAbility;
|
||||
}
|
||||
if(c.para.def != null)
|
||||
{
|
||||
c.para.def *= scaleAbility;
|
||||
}
|
||||
if(c.para.level != null)
|
||||
{
|
||||
c.para.level *= scaleAbility;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.hp *= scaleHp;
|
||||
}
|
||||
}
|
||||
monsterVo.id = o.mid;
|
||||
element = monsterVo.element;
|
||||
hpMax = hp;
|
||||
}
|
||||
|
||||
public function get hp() : int
|
||||
{
|
||||
return _hp.val;
|
||||
}
|
||||
|
||||
public function set hp(val:int) : void
|
||||
{
|
||||
_hp.val = val;
|
||||
}
|
||||
|
||||
public function get apCostSave() : int
|
||||
{
|
||||
return _apCostSave.val;
|
||||
}
|
||||
|
||||
public function set apCostSave(val:int) : void
|
||||
{
|
||||
_apCostSave.val = val;
|
||||
}
|
||||
|
||||
public function checkCheat(checkMon:BattleMonVo) : int
|
||||
{
|
||||
var cheat:int = 0;
|
||||
if(BattlePanel.getIns().battle.battleMode == BattleModeType.PVE)
|
||||
{
|
||||
if(atk * 1.5 < checkMon.atk || def * 1.5 < checkMon.def || hpMax * Table.game_setting.pveHpScale * 1.5 < checkMon.hpMax || dex * 1.5 < checkMon.dex || hpMax * Table.game_setting.pveHpScale * 1.5 < checkMon.hp)
|
||||
{
|
||||
cheat += 20;
|
||||
}
|
||||
}
|
||||
else if(atk * 1.5 < checkMon.atk || def * 1.5 < checkMon.def || hpMax * 1.5 < checkMon.hpMax || dex * 1.5 < checkMon.dex || hpMax * 1.5 < checkMon.hp)
|
||||
{
|
||||
cheat += 20;
|
||||
}
|
||||
if(crit * 1.5 < checkMon.crit || atkVim * 1.5 < checkMon.atkVim || sunFire * 1.5 < checkMon.sunFire || skillCooldown * 1.5 < checkMon.skillCooldown || atkPoi * 1.5 < checkMon.atkPoi || atkStun * 1.5 < checkMon.atkStun || atkPoiDmg * 1.5 < checkMon.atkPoiDmg)
|
||||
{
|
||||
cheat += 20;
|
||||
}
|
||||
return cheat;
|
||||
}
|
||||
|
||||
public function counter(target:BattleMonVo) : Boolean
|
||||
{
|
||||
if(Table.monster_setting.element[monsterVo.element].counter == target.monsterVo.element)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get hpPercent() : Number
|
||||
{
|
||||
return hp / hpMax;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
import net.pixvi.myr.center.StageCenter;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.task.TaskStatusType;
|
||||
|
||||
public class BattlePosition
|
||||
{
|
||||
|
||||
public var battleType:String;
|
||||
|
||||
public var stageId:String;
|
||||
|
||||
public var stageLevel:String;
|
||||
|
||||
public var taskTypeId:String;
|
||||
|
||||
public var taskStep:int;
|
||||
|
||||
public function BattlePosition()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function getBattleData() : Object
|
||||
{
|
||||
switch(battleType)
|
||||
{
|
||||
case "stage":
|
||||
return StageCenter.getIns().getStageBattle(stageId,stageLevel);
|
||||
case BattleType.TASK_BATTLE:
|
||||
return Table.task_info[taskTypeId].steps[taskStep].battle;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getRewardData() : Object
|
||||
{
|
||||
switch(battleType)
|
||||
{
|
||||
case "stage":
|
||||
return StageCenter.getIns().getStageReward(stageId,stageLevel);
|
||||
case BattleType.TASK_BATTLE:
|
||||
return Table.task_info[taskTypeId].steps[taskStep].reward;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function isStageBattle() : Boolean
|
||||
{
|
||||
if(battleType == "stage")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(battleType == BattleType.TASK_BATTLE && Table.task_info[taskTypeId].steps[taskStep].statusType == TaskStatusType.PASS_STAGE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getStageId() : String
|
||||
{
|
||||
if(battleType == "stage")
|
||||
{
|
||||
return stageId;
|
||||
}
|
||||
if(battleType == BattleType.TASK_BATTLE && Table.task_info[taskTypeId].steps[taskStep].statusType == TaskStatusType.PASS_STAGE)
|
||||
{
|
||||
return Table.task_info[taskTypeId].steps[taskStep].statusValue.stage;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getStageLevel() : String
|
||||
{
|
||||
if(battleType == "stage")
|
||||
{
|
||||
return stageLevel;
|
||||
}
|
||||
if(battleType == BattleType.TASK_BATTLE && Table.task_info[taskTypeId].steps[taskStep].statusType == TaskStatusType.PASS_STAGE)
|
||||
{
|
||||
return Table.task_info[taskTypeId].steps[taskStep].statusValue.level;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.Mapper;
|
||||
import net.pixvi.pfw.utils.PointLocker;
|
||||
|
||||
public class BattleTeamVo
|
||||
{
|
||||
|
||||
public static var enemyNormalPointByTeamPos:Object = {
|
||||
"0":"point_team{team}_fore1",
|
||||
"1":"point_team{team}_fore2",
|
||||
"2":"point_team{team}_fore3",
|
||||
"3":"point_team{team}_back1",
|
||||
"4":"point_team{team}_back2",
|
||||
"5":"point_team{team}_back3"
|
||||
};
|
||||
|
||||
public var mons:Array = [];
|
||||
|
||||
public var ai:int = 0;
|
||||
|
||||
public var ai_search:int = 2;
|
||||
|
||||
private var _ap:PointLocker;
|
||||
|
||||
public var apMax:int;
|
||||
|
||||
public var numMax:int;
|
||||
|
||||
public var name:String = "";
|
||||
|
||||
public var numOnStage:int = 0;
|
||||
|
||||
public var buildOver:Boolean = false;
|
||||
|
||||
public var team:int = 2;
|
||||
|
||||
public var wave:int = 1;
|
||||
|
||||
public var waveUnlock:Object = {
|
||||
"0":true,
|
||||
"1":true
|
||||
};
|
||||
|
||||
public var stageMons:Array = [];
|
||||
|
||||
public var deadMons:Array = [];
|
||||
|
||||
public var totalApCost:int = 0;
|
||||
|
||||
public var waitingWave:Boolean = false;
|
||||
|
||||
public function BattleTeamVo()
|
||||
{
|
||||
super();
|
||||
_ap = new PointLocker();
|
||||
}
|
||||
|
||||
public function buildMonster() : void
|
||||
{
|
||||
var k:int = 0;
|
||||
var mon:BattleMon = null;
|
||||
if(buildOver)
|
||||
{
|
||||
return;
|
||||
}
|
||||
k = 0;
|
||||
while(k < mons.length)
|
||||
{
|
||||
mon = new BattleMon();
|
||||
mon.teamVo = this;
|
||||
mon.init(mons[k]);
|
||||
mons[k] = mon;
|
||||
if(mon.team == 2)
|
||||
{
|
||||
if(mon.skill_1 != null)
|
||||
{
|
||||
mon.skill_1.cder.quickCountDown(2);
|
||||
}
|
||||
if(mon.skill_2 != null)
|
||||
{
|
||||
mon.skill_2.cder.quickCountDown(2);
|
||||
}
|
||||
}
|
||||
if(waveUnlock[mon.wave] == null)
|
||||
{
|
||||
waveUnlock[mon.wave] = false;
|
||||
}
|
||||
if(mon.monVo.joinPoint == "" && enemyNormalPointByTeamPos[mon.monVo.teamPos] != null)
|
||||
{
|
||||
mon.monVo.joinPoint = enemyNormalPointByTeamPos[mon.monVo.teamPos];
|
||||
mon.monVo.joinPoint = mon.monVo.joinPoint.replace("{team}",mon.team);
|
||||
}
|
||||
k++;
|
||||
}
|
||||
buildOver = true;
|
||||
}
|
||||
|
||||
public function buildByObject(o:Object, scaleAbility:Number = 1, scaleHp:Number = 1) : void
|
||||
{
|
||||
Mapper.fillVariables(this,o);
|
||||
apMax = ap * 2;
|
||||
buildMonsterArray(mons,scaleAbility,scaleHp);
|
||||
}
|
||||
|
||||
private function buildMonsterArray(arr:Array, scaleAbility:Number = 1, scaleHp:Number = 1) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var vo:BattleMonVo = null;
|
||||
for(i = 0; i < arr.length; )
|
||||
{
|
||||
if(arr[i] != null)
|
||||
{
|
||||
vo = new BattleMonVo();
|
||||
vo.buildByObject(arr[i],scaleAbility,scaleHp);
|
||||
if(arr[i].mid == "" || arr[i].mid == null)
|
||||
{
|
||||
vo.mid = BattlePanel.getTempMID();
|
||||
}
|
||||
else
|
||||
{
|
||||
vo.mid = arr[i].mid;
|
||||
}
|
||||
arr[i] = vo;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAllMonster() : Array
|
||||
{
|
||||
var k:int = 0;
|
||||
if(!buildOver)
|
||||
{
|
||||
throw new Error("所有怪物在没有创建前调用!检查代码");
|
||||
}
|
||||
var arr:Array = [];
|
||||
for(k = 0; k < mons.length; )
|
||||
{
|
||||
if(mons[k] != null)
|
||||
{
|
||||
arr.push(mons[k]);
|
||||
}
|
||||
k++;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
public function getWaitMonster() : Array
|
||||
{
|
||||
return mons;
|
||||
}
|
||||
|
||||
public function monDead(mon:BattleMon) : void
|
||||
{
|
||||
if(mon.monVo.countUnit)
|
||||
{
|
||||
numOnStage--;
|
||||
}
|
||||
ArrayUtil.remove(stageMons,mon);
|
||||
deadMons.push(mon);
|
||||
}
|
||||
|
||||
public function monJoin(mon:BattleMon) : void
|
||||
{
|
||||
ArrayUtil.remove(mons,mon);
|
||||
stageMons.push(mon);
|
||||
if(mon.monVo.countUnit)
|
||||
{
|
||||
numOnStage++;
|
||||
}
|
||||
}
|
||||
|
||||
public function cloneEmptyTeam() : BattleTeamVo
|
||||
{
|
||||
var team:BattleTeamVo = new BattleTeamVo();
|
||||
team.name = "???";
|
||||
team.ai = this.ai;
|
||||
team.ai_search = this.ai_search;
|
||||
team.ap = this.ap;
|
||||
team.apMax = this.apMax;
|
||||
team.buildOver = this.buildOver;
|
||||
team.numMax = this.numMax;
|
||||
team.team = this.team;
|
||||
return team;
|
||||
}
|
||||
|
||||
public function get ap() : int
|
||||
{
|
||||
return _ap.val;
|
||||
}
|
||||
|
||||
public function set ap(value:int) : void
|
||||
{
|
||||
_ap.val = value;
|
||||
}
|
||||
|
||||
public function getAliveNum() : int
|
||||
{
|
||||
var i:int = 0;
|
||||
for each(var mon:BattleMon in stageMons)
|
||||
{
|
||||
if(!mon.monVo.isObject)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
for each(var mon2:BattleMon in mons)
|
||||
{
|
||||
if(!mon2.monVo.isObject)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
public class BattleType
|
||||
{
|
||||
|
||||
public static var TASK_BATTLE:String = "task";
|
||||
|
||||
public static const STAGE_BATTLE:String = "stage";
|
||||
|
||||
public static const PVE_BATTLE:String = "pve";
|
||||
|
||||
public static const BOSS_BATTLE:String = "boss";
|
||||
|
||||
public function BattleType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,259 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
import flash.geom.Point;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.center.Table;
|
||||
import net.pixvi.myr.element.reward.RewardVo;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.Mapper;
|
||||
import net.pixvi.pfw.utils.ObjectUtil;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class BattleVo
|
||||
{
|
||||
|
||||
public var reward:RewardVo;
|
||||
|
||||
public var builded:Boolean = false;
|
||||
|
||||
public var teams:Array = [];
|
||||
|
||||
public var teamDic:Object = {};
|
||||
|
||||
public var groundType:String = "1";
|
||||
|
||||
public var time:int = 300;
|
||||
|
||||
public var controller:Array = [];
|
||||
|
||||
public var triggers:Array = [];
|
||||
|
||||
public var winType:Array = [1];
|
||||
|
||||
public var loseType:Array = [1,2];
|
||||
|
||||
public var battleField:Object;
|
||||
|
||||
public var battleFieldVo:BattleFieldVo;
|
||||
|
||||
public var mapPoints:Object;
|
||||
|
||||
public var mapAreas:Object;
|
||||
|
||||
public var mapObjects:Object;
|
||||
|
||||
public var protectNum:int = 0;
|
||||
|
||||
public var protectMaxNum:int = 0;
|
||||
|
||||
public var destroyNum:int = 0;
|
||||
|
||||
public var destroyMaxNum:int = 0;
|
||||
|
||||
public var bgm:String = "1";
|
||||
|
||||
public var hideTeamMon:Boolean = false;
|
||||
|
||||
public var getBgm:String;
|
||||
|
||||
public var battleMode:int = 0;
|
||||
|
||||
public var scaleAbility:Number = 1;
|
||||
|
||||
public var scaleHp:Number = 1;
|
||||
|
||||
private var hasInitPve:Boolean = false;
|
||||
|
||||
public function BattleVo()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getBgm(bgm:String) : String
|
||||
{
|
||||
switch(bgm)
|
||||
{
|
||||
default:
|
||||
case "1":
|
||||
break;
|
||||
case "2":
|
||||
return GameSound.bgm_danger;
|
||||
case "3":
|
||||
return GameSound.bgm_battle2;
|
||||
}
|
||||
return GameSound.bgm_battle;
|
||||
}
|
||||
|
||||
public function battleBgm() : String
|
||||
{
|
||||
return BattleVo.getBgm(bgm);
|
||||
}
|
||||
|
||||
public function get rollmapMode() : Boolean
|
||||
{
|
||||
return Table.setting.groundType[groundType].rollMap;
|
||||
}
|
||||
|
||||
public function getTeam(team:int) : BattleTeamVo
|
||||
{
|
||||
return teamDic[team];
|
||||
}
|
||||
|
||||
public function getTeamWaitPointName(team:int) : String
|
||||
{
|
||||
var num:int = 0;
|
||||
while(mapPoints["point_team" + team + "_wait" + (num + 1)] != null)
|
||||
{
|
||||
num++;
|
||||
}
|
||||
return "point_team" + team + "_wait" + Random.integer(1,num);
|
||||
}
|
||||
|
||||
public function buildByObject(o:Object) : void
|
||||
{
|
||||
var obj:Array = null;
|
||||
var area:Array = null;
|
||||
var i:int = 0;
|
||||
var vo:BattleTeamVo = null;
|
||||
o = ObjectUtil.deepClone(o);
|
||||
Mapper.fillVariables(this,o);
|
||||
battleFieldVo = new BattleFieldVo();
|
||||
if(o.scaleAbility != null || o.scaleHp != null)
|
||||
{
|
||||
this.scaleAbility = o.scaleAbility;
|
||||
this.scaleHp = o.scaleHp;
|
||||
for each(var cono:Object in controller)
|
||||
{
|
||||
if(cono.type == "monMaker")
|
||||
{
|
||||
if(cono.para.deadBoom != null)
|
||||
{
|
||||
cono.para.deadBoom *= scaleAbility;
|
||||
}
|
||||
if(cono.para.hp != null)
|
||||
{
|
||||
cono.para.hp *= scaleHp;
|
||||
}
|
||||
if(cono.para.hpMax != null)
|
||||
{
|
||||
cono.para.hpMax *= scaleHp;
|
||||
}
|
||||
if(cono.para.atk != null)
|
||||
{
|
||||
cono.para.atk *= scaleAbility;
|
||||
}
|
||||
if(cono.para.def != null)
|
||||
{
|
||||
cono.para.def *= scaleAbility;
|
||||
}
|
||||
if(cono.para.dex != null)
|
||||
{
|
||||
cono.para.dex *= scaleAbility;
|
||||
}
|
||||
if(cono.para.level != null)
|
||||
{
|
||||
cono.para.level *= scaleAbility;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(o.battleField.fieldMode)
|
||||
{
|
||||
obj = o.battleField.mapObjects;
|
||||
area = o.battleField.mapAreas;
|
||||
o.battleField = ObjectUtil.deepClone(Table.setting.defaultField[o.battleField.fieldName]);
|
||||
o.battleField.mapObjects = ObjectUtil.deepClone(obj);
|
||||
o.battleField.mapAreas = (o.battleField.mapAreas as Array).concat(ObjectUtil.deepClone(area));
|
||||
}
|
||||
Mapper.fillVariables(battleFieldVo,o.battleField);
|
||||
ArrayUtil.allToInt(o.winType);
|
||||
ArrayUtil.allToInt(o.loseType);
|
||||
for(i = 0; i < teams.length; )
|
||||
{
|
||||
vo = new BattleTeamVo();
|
||||
vo.buildByObject(teams[i],scaleAbility,scaleHp);
|
||||
teams[i] = vo;
|
||||
for each(var m:BattleMonVo in vo.mons)
|
||||
{
|
||||
if(m.protectTarget)
|
||||
{
|
||||
protectMaxNum++;
|
||||
}
|
||||
else if(m.destroyTarget)
|
||||
{
|
||||
destroyMaxNum++;
|
||||
}
|
||||
}
|
||||
teamDic[vo.team] = vo;
|
||||
i++;
|
||||
}
|
||||
protectNum = protectMaxNum;
|
||||
destroyNum = destroyMaxNum;
|
||||
if(o.time == -1)
|
||||
{
|
||||
o.time = GameMath.normalBattleTime;
|
||||
}
|
||||
time = o.time;
|
||||
mapPoints = ObjectUtil.tableToObject(battleFieldVo.mapPoints);
|
||||
mapObjects = ObjectUtil.tableToObject(battleFieldVo.mapObjects);
|
||||
mapAreas = ObjectUtil.tableToObject(battleFieldVo.mapAreas);
|
||||
}
|
||||
|
||||
public function fixMonTeamBeforeBuild() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var nt:BattleTeamVo = null;
|
||||
for each(var t:BattleTeamVo in teams)
|
||||
{
|
||||
for(i = 0; i < t.mons.length; )
|
||||
{
|
||||
if(t.mons[i].team != t.team)
|
||||
{
|
||||
if(teamDic[t.mons[i].team] == null)
|
||||
{
|
||||
nt = t.cloneEmptyTeam();
|
||||
nt.team = t.mons[i].team;
|
||||
teams.push(nt);
|
||||
teamDic[t.mons[i].team] = nt;
|
||||
}
|
||||
teamDic[t.mons[i].team].mons.push(t.mons.splice(i,1)[0]);
|
||||
i--;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getBattleArea() : Object
|
||||
{
|
||||
return mapAreas.area_battlefield;
|
||||
}
|
||||
|
||||
public function getBattleAreaRandomPoint() : Point
|
||||
{
|
||||
var p:Point = new Point();
|
||||
p.x = getBattleArea().x + getBattleArea().w * Math.random();
|
||||
p.y = getBattleArea().y + getBattleArea().h * Math.random();
|
||||
return p;
|
||||
}
|
||||
|
||||
public function initPve() : void
|
||||
{
|
||||
if(!hasInitPve)
|
||||
{
|
||||
for each(var team:BattleTeamVo in teams)
|
||||
{
|
||||
for each(var monvo:BattleMonVo in team.mons)
|
||||
{
|
||||
monvo.hp *= Table.game_setting.pveHpScale;
|
||||
monvo.hpMax = monvo.hp;
|
||||
}
|
||||
team.ap = team.apMax * Table.game_setting.pveApStartScale;
|
||||
}
|
||||
}
|
||||
trace("初始化pve魔物");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package net.pixvi.myr.element.battle
|
||||
{
|
||||
public class CheatRecord
|
||||
{
|
||||
|
||||
public var mons:Array = [];
|
||||
|
||||
public var damages:Array = [];
|
||||
|
||||
public var master:Object;
|
||||
|
||||
public var text:String = "";
|
||||
|
||||
public function CheatRecord()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function addRecord(str:String) : void
|
||||
{
|
||||
if(str.indexOf("skillTable_223") != -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(str.indexOf("skillTable_57") != -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
text += str + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package net.pixvi.myr.element.battle.battlearea
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BaseBattleArea;
|
||||
|
||||
public class BattleAreaHp extends BaseBattleArea
|
||||
{
|
||||
|
||||
public function BattleAreaHp()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cooldown = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function activity(mon:BattleMon) : void
|
||||
{
|
||||
if(para.team != null && para.team != mon.team)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(int(para.hp) > 0)
|
||||
{
|
||||
if(para.percentMode)
|
||||
{
|
||||
mon.beCure(4,mon.monVo.hpMax * para.hp,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
mon.beCure(4,para.hp,true);
|
||||
}
|
||||
}
|
||||
else if(para.percentMode)
|
||||
{
|
||||
mon.beHurt(4,null,mon.monVo.hpMax * int(-para.hp),para.realAtk,false,0,0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
mon.beHurt(4,null,int(-para.hp),para.realAtk,false,0,0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package net.pixvi.myr.element.battle.battlearea
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BaseBattleArea;
|
||||
|
||||
public class BattleAreaMoveSpeed extends BaseBattleArea
|
||||
{
|
||||
|
||||
public function BattleAreaMoveSpeed()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cooldown = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function activity(mon:BattleMon) : void
|
||||
{
|
||||
if(para.team != null && para.team != mon.team)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(para.percentMode)
|
||||
{
|
||||
mon.buff.buff_movespd(para.speed * mon.all_movespd,para.time);
|
||||
}
|
||||
else
|
||||
{
|
||||
mon.buff.buff_movespd(para.speed,para.time);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package net.pixvi.myr.element.battle.battlearea
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BaseBattleArea;
|
||||
|
||||
public class BattleAreaPow extends BaseBattleArea
|
||||
{
|
||||
|
||||
public function BattleAreaPow()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cooldown = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function activity(mon:BattleMon) : void
|
||||
{
|
||||
var px:Number = NaN;
|
||||
var py:Number = NaN;
|
||||
if(para.fromX == null)
|
||||
{
|
||||
px = mon.x;
|
||||
}
|
||||
else
|
||||
{
|
||||
px = Number(para.fromX);
|
||||
}
|
||||
if(para.fromY == null)
|
||||
{
|
||||
py = mon.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
py = Number(para.fromY);
|
||||
}
|
||||
mon.givePow(para.pow,px,py,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package net.pixvi.myr.element.battle.battlearea
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BaseBattleArea;
|
||||
|
||||
public class BattleAreaPowDef extends BaseBattleArea
|
||||
{
|
||||
|
||||
public function BattleAreaPowDef()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cooldown = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function activity(mon:BattleMon) : void
|
||||
{
|
||||
if(para.percentMode)
|
||||
{
|
||||
mon.buff.buff_powdef(mon.all_powdef * para.powdef,para.time);
|
||||
}
|
||||
else
|
||||
{
|
||||
mon.buff.buff_powdef(para.powdef,para.time);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package net.pixvi.myr.element.battle.battlearea
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BaseBattleArea;
|
||||
|
||||
public class BattleAreaSpeed extends BaseBattleArea
|
||||
{
|
||||
|
||||
public function BattleAreaSpeed()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cooldown = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function activity(mon:BattleMon) : void
|
||||
{
|
||||
mon.addSpd(para.speedX,para.speedY,para.maxX,para.maxY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package net.pixvi.myr.element.battle.battlearea
|
||||
{
|
||||
import net.pixvi.myr.element.battle.BaseBattleArea;
|
||||
|
||||
public class BattleAreaType
|
||||
{
|
||||
|
||||
public static var dic:Object = {
|
||||
"none":{
|
||||
"type":"none",
|
||||
"des":"无类型",
|
||||
"para":{}
|
||||
},
|
||||
"hp":{
|
||||
"type":"hp",
|
||||
"des":"生命值",
|
||||
"para":{
|
||||
"interval":1000,
|
||||
"realAtk":true,
|
||||
"hp":-10,
|
||||
"percentMode":false
|
||||
}
|
||||
},
|
||||
"movespd":{
|
||||
"type":"movespd",
|
||||
"des":"移动速度",
|
||||
"para":{
|
||||
"interval":500,
|
||||
"time":500,
|
||||
"speed":0.5,
|
||||
"percentMode":true
|
||||
}
|
||||
},
|
||||
"pow":{
|
||||
"type":"pow",
|
||||
"des":"放射加速",
|
||||
"para":{
|
||||
"interval":250,
|
||||
"pow":2,
|
||||
"fromX":0,
|
||||
"fromY":0
|
||||
}
|
||||
},
|
||||
"speed":{
|
||||
"type":"speed",
|
||||
"des":"向量加速",
|
||||
"para":{
|
||||
"interval":250,
|
||||
"speedX":2,
|
||||
"speedY":2,
|
||||
"maxX":100,
|
||||
"maxY":100
|
||||
}
|
||||
},
|
||||
"powdef":{
|
||||
"type":"powdef",
|
||||
"des":"击退防御",
|
||||
"para":{
|
||||
"interval":500,
|
||||
"time":500,
|
||||
"powdef":-5,
|
||||
"percentMode":false
|
||||
}
|
||||
},
|
||||
"block":{
|
||||
"type":"block",
|
||||
"des":"障碍物",
|
||||
"para":{"interval":50}
|
||||
}
|
||||
};
|
||||
|
||||
public function BattleAreaType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getByType(type:String) : BaseBattleArea
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case "none":
|
||||
return new BaseBattleArea();
|
||||
case "hp":
|
||||
return new BattleAreaHp();
|
||||
case "movespd":
|
||||
return new BattleAreaMoveSpeed();
|
||||
case "pow":
|
||||
return new BattleAreaPow();
|
||||
case "speed":
|
||||
return new BattleAreaSpeed();
|
||||
case "powdef":
|
||||
return new BattleAreaPowDef();
|
||||
case "block":
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function getByVo(vo:Object) : BaseBattleArea
|
||||
{
|
||||
var base:BaseBattleArea = getByType(vo.type);
|
||||
base.buildByObject(vo);
|
||||
return base;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
package net.pixvi.myr.element.battle.battlecontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.interfaces.IDispose;
|
||||
|
||||
public class BaseBattleController implements IDispose
|
||||
{
|
||||
|
||||
public var id:String;
|
||||
|
||||
public var type:String;
|
||||
|
||||
public var para:Object;
|
||||
|
||||
public var timer:Cooldowner;
|
||||
|
||||
public var afterWave:int = -1;
|
||||
|
||||
public var afterWaveTeam:int = 2;
|
||||
|
||||
public var afterTime:int = 0;
|
||||
|
||||
public var beforeTime:int = 0;
|
||||
|
||||
public var activited:Boolean = true;
|
||||
|
||||
public function BaseBattleController()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function buildByObject(obj:Object) : void
|
||||
{
|
||||
this.id = obj.id;
|
||||
this.type = obj.type;
|
||||
this.para = obj.para;
|
||||
timer = new Cooldowner(this.para.interval);
|
||||
if(this.para.beforeTime != null)
|
||||
{
|
||||
beforeTime = this.para.beforeTime;
|
||||
if(beforeTime < 1000)
|
||||
{
|
||||
beforeTime *= 1000;
|
||||
}
|
||||
}
|
||||
if(this.para.afterTime != null)
|
||||
{
|
||||
afterTime = this.para.afterTime;
|
||||
if(afterTime < 1000)
|
||||
{
|
||||
afterTime *= 1000;
|
||||
}
|
||||
}
|
||||
if(this.para.afterWave != null)
|
||||
{
|
||||
afterWave = this.para.afterWave;
|
||||
}
|
||||
if(this.para.afterWaveTeam != null)
|
||||
{
|
||||
afterWaveTeam = this.para.afterWaveTeam;
|
||||
}
|
||||
if(this.para.activited != null)
|
||||
{
|
||||
activited = this.para.activited;
|
||||
}
|
||||
init();
|
||||
}
|
||||
|
||||
public function start() : void
|
||||
{
|
||||
timer.resume();
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
if(!activited)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(afterTime > 0 && BattlePanel.getT().passTime < afterTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(beforeTime > 0 && BattlePanel.getT().passTime > beforeTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(afterWave >= 0 && BattlePanel.getIns().ground.vo.getTeam(afterWaveTeam).wave < afterWave)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(timer.cooldown)
|
||||
{
|
||||
timer.activity();
|
||||
activity();
|
||||
}
|
||||
}
|
||||
|
||||
public function activity() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
timer.pause();
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
timer.resume();
|
||||
}
|
||||
|
||||
public function dispose() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package net.pixvi.myr.element.battle.battlecontroller
|
||||
{
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class BattleControllerBuff extends BaseBattleController
|
||||
{
|
||||
|
||||
public function BattleControllerBuff()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function activity() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var mon:BattleMon = null;
|
||||
var num:int = 0;
|
||||
var j:int = 0;
|
||||
var targetMons:Array = [];
|
||||
for(i = 0; i < BattlePanel.getIns().ground.monsters.length; )
|
||||
{
|
||||
mon = BattlePanel.getIns().ground.monsters[i];
|
||||
if(!mon.monVo.dead)
|
||||
{
|
||||
if(para.targetMode == "all")
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
else if(para.targetMode == "team" && mon.team.toString() == para.target)
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
else if(para.targetMode == "mon")
|
||||
{
|
||||
if(para.target is Array && para.target.indexOf(mon.mid.toString()) != -1)
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
else if(mon.mid.toString() == para.target)
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(targetMons.length > 0)
|
||||
{
|
||||
num = int(targetMons.length);
|
||||
if(para.randomTarget > 0)
|
||||
{
|
||||
targetMons = Random.randomArr(targetMons);
|
||||
num = int(para.randomTarget);
|
||||
if(num > targetMons.length)
|
||||
{
|
||||
num = int(targetMons.length);
|
||||
}
|
||||
}
|
||||
for(j = 0; j < num; )
|
||||
{
|
||||
if(para.randomChance == 1 || para.randomChance < 1 && Math.random() < para.randomChance)
|
||||
{
|
||||
(targetMons[j] as BattleMon).buff.activityByObjectType2(para);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package net.pixvi.myr.element.battle.battlecontroller
|
||||
{
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class BattleControllerMonBuff extends BaseBattleController
|
||||
{
|
||||
|
||||
public function BattleControllerMonBuff()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function activity() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var mon:BattleMon = null;
|
||||
var num:int = 0;
|
||||
var j:int = 0;
|
||||
var targetMons:Array = [];
|
||||
for(i = 0; i < BattlePanel.getIns().ground.monsters.length; )
|
||||
{
|
||||
mon = BattlePanel.getIns().ground.monsters[i];
|
||||
if(!mon.monVo.dead)
|
||||
{
|
||||
if(para.targetMode == "all")
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
else if(para.targetMode == "team" && mon.team.toString() == para.target)
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
else if(para.targetMode == "mon")
|
||||
{
|
||||
if(para.target is Array && para.target.indexOf(mon.mid.toString()) != -1)
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
else if(mon.mid.toString() == para.target)
|
||||
{
|
||||
targetMons.push(mon);
|
||||
}
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if(targetMons.length > 0)
|
||||
{
|
||||
num = int(targetMons.length);
|
||||
if(para.randomTarget > 0)
|
||||
{
|
||||
targetMons = Random.randomArr(targetMons);
|
||||
num = int(para.randomTarget);
|
||||
if(num > targetMons.length)
|
||||
{
|
||||
num = int(targetMons.length);
|
||||
}
|
||||
}
|
||||
for(j = 0; j < num; )
|
||||
{
|
||||
if(para.randomChance == 1 || para.randomChance < 1 && Math.random() < para.randomChance)
|
||||
{
|
||||
((targetMons[j] as BattleMon).buff[para.buffFunction] as Function).apply(mon,para.buffPara);
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package net.pixvi.myr.element.battle.battlecontroller
|
||||
{
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.center.BattleCenter;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
import net.pixvi.pfw.utils.Random;
|
||||
|
||||
public class BattleControllerMonMaker extends BaseBattleController
|
||||
{
|
||||
|
||||
public function BattleControllerMonMaker()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function activity() : void
|
||||
{
|
||||
var m:BattleMon = BattleCenter.getIns().makeBattleMon(para.monType,para.level,para.team,para.mode,para.oscale * BattleMon.OSCALE,para.name);
|
||||
m.monVo.ai = para.ai;
|
||||
m.monVo.ai_search = para.ai_search;
|
||||
if(para.bossPoint != null)
|
||||
{
|
||||
m.monVo.bossPoint = para.bossPoint;
|
||||
}
|
||||
if(para.deadBoom != null)
|
||||
{
|
||||
m.buff.deadboom_atk = para.deadBoom;
|
||||
m.buff.deadboom_length = 300;
|
||||
m.buff.deadboom_pow = 10;
|
||||
m.buff.open_deadboom = true;
|
||||
}
|
||||
if(para.hpBuff != null)
|
||||
{
|
||||
m.buff.buff_hps(para.hpBuff,60000,para.hpBuffInternal);
|
||||
}
|
||||
if(para.canMove != null)
|
||||
{
|
||||
m.moveable = para.canMove;
|
||||
}
|
||||
if(para.isObject != null)
|
||||
{
|
||||
m.monVo.isObject = para.isObject;
|
||||
}
|
||||
var pointname:String = "";
|
||||
if((para.point as String).indexOf(",") > 0)
|
||||
{
|
||||
pointname = Random.element((para.point as String).split(",")).toString();
|
||||
}
|
||||
else
|
||||
{
|
||||
pointname = para.point;
|
||||
}
|
||||
var point:Object = BattlePanel.getIns().battle.mapPoints[pointname];
|
||||
m.x = point.x + Math.random() * point.w;
|
||||
m.y = point.y + Math.random() * point.h;
|
||||
m.faceTo(point.face);
|
||||
m.addSpd(para.speedX,para.speedY);
|
||||
var color:uint = uint(Paster.parseColor(para.flashColor));
|
||||
if(color)
|
||||
{
|
||||
new FlashEffect(600,color,para.flashAmount);
|
||||
}
|
||||
if(para.joinAction != null)
|
||||
{
|
||||
m.monVo.joinAction = para.joinAction;
|
||||
}
|
||||
if(para.hp != null)
|
||||
{
|
||||
m.monVo.hp = m.monVo.hpMax = para.hp;
|
||||
}
|
||||
if(para.hpMax != null)
|
||||
{
|
||||
m.monVo.hpMax = para.hpMax;
|
||||
}
|
||||
if(para.atk != null)
|
||||
{
|
||||
m.monVo.atk = para.atk;
|
||||
}
|
||||
if(para.atk_dis != null)
|
||||
{
|
||||
m.monVo.atk_dis = para.atk_dis;
|
||||
}
|
||||
BattlePanel.getIns().ground.addMonster(m,true,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
package net.pixvi.myr.element.battle.battlecontroller
|
||||
{
|
||||
public class BattleControllerType
|
||||
{
|
||||
|
||||
public static var dic:Object = {
|
||||
"base":{
|
||||
"type":"base",
|
||||
"des":"基础通用属性",
|
||||
"para":{
|
||||
"activited":true,
|
||||
"beforeTime":0,
|
||||
"afterTime":0,
|
||||
"afterWave":0,
|
||||
"afterWaveTeam":2
|
||||
}
|
||||
},
|
||||
"none":{
|
||||
"type":"none",
|
||||
"des":"无",
|
||||
"para":{}
|
||||
},
|
||||
"monMaker":{
|
||||
"type":"monMaker",
|
||||
"des":"魔物发生器",
|
||||
"para":{
|
||||
"deadBoom":null,
|
||||
"hpBuff":null,
|
||||
"hpBuffInternal":null,
|
||||
"isObject":null,
|
||||
"canMove":null,
|
||||
"hp":null,
|
||||
"hpMax":null,
|
||||
"atk":null,
|
||||
"point":"point_team2_wait1",
|
||||
"joinAction":"none",
|
||||
"interval":5000,
|
||||
"monType":1001010,
|
||||
"level":1,
|
||||
"mode":2,
|
||||
"name":"",
|
||||
"oscale":0,
|
||||
"team":2,
|
||||
"ai":0,
|
||||
"ai_search":2,
|
||||
"speedX":0,
|
||||
"speedY":2,
|
||||
"flashColor":"#ffffff",
|
||||
"flashAmount":0.7
|
||||
}
|
||||
},
|
||||
"monBuff":{
|
||||
"type":"monBuff",
|
||||
"des":"魔物buff发生器",
|
||||
"para":{
|
||||
"target":"10001",
|
||||
"targetMode":"mon/team/all",
|
||||
"randomTarget":0,
|
||||
"randomChance":1,
|
||||
"interval":5000,
|
||||
"buffFunction":"",
|
||||
"buffPara":[]
|
||||
}
|
||||
},
|
||||
"buff":{
|
||||
"type":"buff",
|
||||
"des":"施加魔物buff",
|
||||
"para":{
|
||||
"target":"10001",
|
||||
"targetMode":"monId/team/all",
|
||||
"interval":5000,
|
||||
"buff":"stun",
|
||||
"movType":1,
|
||||
"randomTarget":0,
|
||||
"randomChance":1
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public function BattleControllerType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getByType(type:String) : BaseBattleController
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case "base":
|
||||
case "none":
|
||||
break;
|
||||
case "monMaker":
|
||||
return new BattleControllerMonMaker();
|
||||
case "monBuff":
|
||||
return new BattleControllerMonBuff();
|
||||
case "buff":
|
||||
return new BattleControllerBuff();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
return new BaseBattleController();
|
||||
}
|
||||
|
||||
public static function buildByObject(o:Object) : BaseBattleController
|
||||
{
|
||||
var b:BaseBattleController = getByType(o.type);
|
||||
b.buildByObject(o);
|
||||
return b;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.pfw.interfaces.IDispose;
|
||||
|
||||
public class BaseMonController implements IDispose
|
||||
{
|
||||
|
||||
public var mon:BattleMon;
|
||||
|
||||
public var id:String;
|
||||
|
||||
public var type:String;
|
||||
|
||||
public var para:Object;
|
||||
|
||||
public var openHurt:Boolean = false;
|
||||
|
||||
public function BaseMonController()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public function buildByObject(obj:Object, mon:BattleMon) : void
|
||||
{
|
||||
this.id = obj.id;
|
||||
this.type = obj.type;
|
||||
this.para = obj.para;
|
||||
this.mon = mon;
|
||||
init();
|
||||
}
|
||||
|
||||
public function start() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function init() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function deadHandler() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function onHurt(damage:int, enemy:BattleMon) : Object
|
||||
{
|
||||
return {"damage":0};
|
||||
}
|
||||
|
||||
public function dispose() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
|
||||
public class MonControllerAdd extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerAdd()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
mon.monVo.pow += para.pow;
|
||||
mon.monVo.atk_dis += para.atkDis;
|
||||
mon.monVo.atkStun += para.atkStun;
|
||||
mon.monVo.defStun += para.defStun;
|
||||
mon.monVo.atkVim += para.vampire;
|
||||
mon.monVo.thorns += para.thorn;
|
||||
mon.monVo.atkPoi += para.poi;
|
||||
mon.monVo.atkPoiDmg += para.poiDamage;
|
||||
if(para.defDama != null)
|
||||
{
|
||||
mon.monVo.defDama += Number(para.defDama);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import flash.display.DisplayObject;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
|
||||
public class MonControllerBosouBoom extends BaseMonController
|
||||
{
|
||||
|
||||
public function MonControllerBosouBoom()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function deadHandler() : void
|
||||
{
|
||||
var tmon:BattleMon = null;
|
||||
var mons:Array = BattlePanel.getIns().ground.findMonsByMonNear(mon,para.w,para.h,para.exceptTeam);
|
||||
var vis:DisplayObject = mon.addMovByClassInGround("mov.hit26",0,2.4,1.5,6);
|
||||
TweenMax.to(vis,2,{"scaleX":vis.scaleX + 1.5});
|
||||
if(para.atk == null)
|
||||
{
|
||||
para.atk = 5;
|
||||
}
|
||||
for each(var m:BattleMon in mons)
|
||||
{
|
||||
m.buff.buff_bosou(para.time);
|
||||
m.buff.buff_atk(-m.all_atk * 0.5,para.time);
|
||||
tmon = BattlePanel.getIns().ground.findNearestMon(m.x,m.y,2000,m.team,m.mid);
|
||||
if(tmon != null)
|
||||
{
|
||||
m.stopTargetMove();
|
||||
m.targetMon = tmon;
|
||||
m.buff.addBuffMov("mov.BuffInsane","bosou",para.time,1,24,0,0,-50);
|
||||
m.beHurt(5,mon,para.atk,false,false,para.pow);
|
||||
m.addMovByClass("mov.hit26",0,1.5,1.5,12);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
|
||||
public class MonControllerBuff extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerBuff()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var targetMon:BattleMon = null;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
if(para.mid != null && para.mid != -1)
|
||||
{
|
||||
targetMon = BattlePanel.getIns().ground.findMonByMid(para.mid);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetMon = mon;
|
||||
}
|
||||
if(targetMon == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
targetMon.buff.activityByObjectType2(para);
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
|
||||
public class MonControllerBuffMon extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerBuffMon()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var targetMon:BattleMon = null;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
if(para.mid != null && para.mid != -1)
|
||||
{
|
||||
targetMon = BattlePanel.getIns().ground.findMonByMid(para.mid);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetMon = mon;
|
||||
}
|
||||
if(targetMon == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
(targetMon.buff[para.func] as Function).apply(targetMon.buff,para.para);
|
||||
if(para.mov != null && (para.mov as Array).length > 0)
|
||||
{
|
||||
targetMon.buff.addBuffMov.apply(targetMon.buff,para.mov);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import com.greensock.TweenMax;
|
||||
import net.pixvi.pfw.display.BitMovieClip;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
|
||||
public class MonControllerBuffMovie extends BaseMonController
|
||||
{
|
||||
|
||||
public var bmc:BitMovieClip;
|
||||
|
||||
public var wait:Boolean = false;
|
||||
|
||||
public function MonControllerBuffMovie()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
var bmc:BitMovieClip = null;
|
||||
if(mon.leg.readyActioning || mon.cacheHeight == -1)
|
||||
{
|
||||
Caller.delayCall(start,100);
|
||||
wait = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mon.monVo.dead)
|
||||
{
|
||||
return;
|
||||
}
|
||||
bmc = mon.buff.addBuffMov(para.mov,para.type,int(para.time),para.scale,para.fps,para.position,para.floatX,para.floatY,para.front,para.stopMove,para.preCheck);
|
||||
if(bmc != null && wait)
|
||||
{
|
||||
wait = false;
|
||||
bmc.alpha = 0;
|
||||
TweenMax.to(bmc,0.5,{"alpha":1});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
super.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
super.resume();
|
||||
}
|
||||
|
||||
override public function dispose() : void
|
||||
{
|
||||
super.dispose();
|
||||
Caller.stopCall(start);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.center.SoundCenter;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.snd.GameSound;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
|
||||
public class MonControllerDeadBoom extends BaseMonController
|
||||
{
|
||||
|
||||
public function MonControllerDeadBoom()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function deadHandler() : void
|
||||
{
|
||||
if(para.mov == null)
|
||||
{
|
||||
para.mov = "mov.skill2";
|
||||
}
|
||||
SoundCenter.getIns().play(GameSound.soundName("skill_boom"));
|
||||
var mons:Array = BattlePanel.getIns().ground.findMonsByMonNear(mon,para.w,para.h,para.exceptTeam);
|
||||
mon.addMovByClassInGround(para.mov,0,1.8,1.8,30);
|
||||
for each(var m:BattleMon in mons)
|
||||
{
|
||||
m.buff.buff_bosou(para.time);
|
||||
m.beHurt(5,mon,para.atk,false,false,para.pow);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class MonControllerFixHurt extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerFixHurt()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
openHurt = true;
|
||||
}
|
||||
|
||||
override public function onHurt(damage:int, enemy:BattleMon) : Object
|
||||
{
|
||||
var rpara:Object = {"damage":damage};
|
||||
if(enemy != null)
|
||||
{
|
||||
if(para.type[enemy.vo.element.toString()] != null)
|
||||
{
|
||||
rpara.damage = damage * para.element[enemy.vo.element.toString()];
|
||||
rpara.iscount = true;
|
||||
}
|
||||
else if(para.type[enemy.vo.type.toString()] != null)
|
||||
{
|
||||
rpara.damage = damage * para.type[enemy.vo.type.toString()];
|
||||
rpara.iscount = true;
|
||||
}
|
||||
}
|
||||
return rpara;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class MonControllerHp extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerHp()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var targetmon:BattleMon = null;
|
||||
var realAtk:Boolean = false;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
if(para.mid == null || para.mid == -1)
|
||||
{
|
||||
targetmon = mon;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetmon = BattleGround.getIns().findMonByMid(para.mid);
|
||||
if(targetmon == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
realAtk = true;
|
||||
if(para.realAtk != null)
|
||||
{
|
||||
realAtk = Boolean(para.realAtk);
|
||||
}
|
||||
if(para.hp < 0)
|
||||
{
|
||||
targetmon.beHurt(9,null,-para.hp,realAtk,false,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetmon.beCure(12,para.hp,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class MonControllerHpArea extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerHpArea()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var mons:Array = null;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
mons = [];
|
||||
if(para.hp < 0)
|
||||
{
|
||||
mon.addMovByClass("mov.BuffSunFire",3,1.5,1.5,30,0,0,0,null,null,false);
|
||||
mons = BattleGround.getIns().findMonsByMonNear(mon,para.area,para.area * 0.6,mon.team);
|
||||
for each(var m:BattleMon in mons)
|
||||
{
|
||||
m.beHurt(6,mon,-para.hp,true,false,0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mon.addMovByClass("mov.BuffMoonHeal",3,1.5,1.5,30,0,0,0,null,null,false);
|
||||
mons = BattleGround.getIns().findMonsByMonNear(mon,para.area,para.area,mon.team == 1 ? 2 : 1);
|
||||
for each(var m2:BattleMon in mons)
|
||||
{
|
||||
m2.beCure(13,para.hp,false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
|
||||
public class MonControllerLockTarget extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerLockTarget()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
var time:int = 1000;
|
||||
if(para.interval != null)
|
||||
{
|
||||
time = int(para.interval);
|
||||
}
|
||||
cd = new Cooldowner(time);
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var targetMon:BattleMon = null;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
targetMon = BattlePanel.getIns().ground.findMonByMid(para.mid);
|
||||
if(targetMon == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
mon.targetMon = targetMon;
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.effect.effects.FlashEffect;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.center.BattleCenter;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
import net.pixvi.pfw.utils.Paster;
|
||||
|
||||
public class MonControllerMonMaker extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public function MonControllerMonMaker()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.interval);
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var m:BattleMon = null;
|
||||
var color:* = 0;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
m = BattleCenter.getIns().makeBattleMon(para.monType,para.level,para.team,para.mode,para.oscale * BattleMon.OSCALE);
|
||||
m.monVo.ai = para.ai;
|
||||
m.monVo.ai_search = para.ai_search;
|
||||
m.x = mon.x + para.floatX;
|
||||
m.y = mon.y + para.floatY;
|
||||
if(para.bossPoint != null)
|
||||
{
|
||||
m.monVo.bossPoint = para.bossPoint;
|
||||
}
|
||||
m.addSpd(para.speedX,para.speedY);
|
||||
color = uint(Paster.parseColor(para.flashColor));
|
||||
if(color)
|
||||
{
|
||||
new FlashEffect(600,color,para.flashAmount);
|
||||
}
|
||||
if(para.joinAction != null)
|
||||
{
|
||||
m.monVo.joinAction = para.joinAction;
|
||||
}
|
||||
if(para.hp != null)
|
||||
{
|
||||
m.monVo.hp = m.monVo.hpMax = para.hp;
|
||||
}
|
||||
if(para.hpMax != null)
|
||||
{
|
||||
m.monVo.hpMax = para.hpMax;
|
||||
}
|
||||
if(para.atk != null)
|
||||
{
|
||||
m.monVo.atk = para.atk;
|
||||
}
|
||||
BattlePanel.getIns().ground.addMonster(m,true,false);
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
|
||||
public class MonControllerMonSkill extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public var skills:Array = [];
|
||||
|
||||
public var times:Array = [];
|
||||
|
||||
public var flag:int = 0;
|
||||
|
||||
public function MonControllerMonSkill()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.startTime);
|
||||
skills = para.skill;
|
||||
times = para.times;
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
if(times != null)
|
||||
{
|
||||
cd.otime = times[flag];
|
||||
}
|
||||
if(skills[flag] == 1)
|
||||
{
|
||||
if(mon.skill_1 != null)
|
||||
{
|
||||
mon.skill_1.activity();
|
||||
}
|
||||
}
|
||||
else if(mon.skill_2 != null)
|
||||
{
|
||||
mon.skill_2.activity();
|
||||
}
|
||||
flag++;
|
||||
if(flag >= skills.length)
|
||||
{
|
||||
flag = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import flash.geom.Point;
|
||||
import net.pixvi.common.utils.Alert;
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.GameMath;
|
||||
import net.pixvi.myr.panel.battle.BattlePanel;
|
||||
|
||||
public class MonControllerMonSteps extends BaseMonController
|
||||
{
|
||||
|
||||
public var cd:Cooldowner;
|
||||
|
||||
public var points:Array = [];
|
||||
|
||||
public var times:Array = [];
|
||||
|
||||
public var flag:int = 0;
|
||||
|
||||
public function MonControllerMonSteps()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
cd = new Cooldowner(para.startTime);
|
||||
points = para.points;
|
||||
times = para.times;
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
cd.activity();
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
var pointobj:Object = null;
|
||||
var x:int = 0;
|
||||
var y:int = 0;
|
||||
if(cd.cooldown)
|
||||
{
|
||||
cd.activity();
|
||||
if(times != null)
|
||||
{
|
||||
cd.otime = times[flag];
|
||||
}
|
||||
if(para.addSpd > 0 && para.addSpdTime > 0)
|
||||
{
|
||||
mon.buff.buff_movespd(mon.all_movespd * para.addSpd,para.addSpdTime);
|
||||
}
|
||||
pointobj = BattlePanel.getIns().battle.mapPoints[points[flag]];
|
||||
if(pointobj == null && GameMath.ModeTrace)
|
||||
{
|
||||
Alert.showMsg("魔物路劲控制器找不到point[" + points[flag] + "]");
|
||||
return;
|
||||
}
|
||||
x = pointobj.x + Math.random() * pointobj.w;
|
||||
y = pointobj.y + Math.random() * pointobj.h;
|
||||
mon.stopTargetMove();
|
||||
mon.targetPoint = new Point(x,y);
|
||||
flag++;
|
||||
if(flag >= points.length)
|
||||
{
|
||||
flag = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
cd.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
cd.resume();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import flash.events.Event;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
|
||||
public class MonControllerShowFace extends BaseMonController
|
||||
{
|
||||
|
||||
public function MonControllerShowFace()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
if(para.when == "born")
|
||||
{
|
||||
Caller.delayCall(showFaceDelay,para.delay);
|
||||
}
|
||||
if(para.when == "hurt")
|
||||
{
|
||||
mon.addEventListener(BattleMon.BE_HURT,beHurt);
|
||||
}
|
||||
}
|
||||
|
||||
private function showFaceDelay() : void
|
||||
{
|
||||
mon.showFace(para.face);
|
||||
}
|
||||
|
||||
private function beHurt(e:Event = null) : void
|
||||
{
|
||||
if(Math.random() < para.chance)
|
||||
{
|
||||
mon.showFace(para.face);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
public class MonControllerStatusMov extends BaseMonController
|
||||
{
|
||||
|
||||
public function MonControllerStatusMov()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
override public function init() : void
|
||||
{
|
||||
}
|
||||
|
||||
override public function start() : void
|
||||
{
|
||||
if(para.mov == "walk")
|
||||
{
|
||||
mon.monMov.statusWalk(para.delay);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,293 @@
|
||||
package net.pixvi.myr.element.battle.moncontroller
|
||||
{
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class MonControllerType
|
||||
{
|
||||
|
||||
public static var dic:Object = {
|
||||
"none":{
|
||||
"type":"none",
|
||||
"sort":1,
|
||||
"des":"无",
|
||||
"para":{}
|
||||
},
|
||||
"add":{
|
||||
"type":"add",
|
||||
"sort":1,
|
||||
"des":"特殊属性add(双倍)",
|
||||
"para":{
|
||||
"defDama":0,
|
||||
"thorn":0,
|
||||
"atkStun":0,
|
||||
"defStun":0,
|
||||
"vampire":0,
|
||||
"pow":0,
|
||||
"poi":0,
|
||||
"poiDamage":0,
|
||||
"atkDis":0
|
||||
}
|
||||
},
|
||||
"monMaker":{
|
||||
"type":"monMaker",
|
||||
"sort":2,
|
||||
"des":"魔物发生器",
|
||||
"para":{
|
||||
"hp":null,
|
||||
"hpMax":null,
|
||||
"atk":null,
|
||||
"joinAction":null,
|
||||
"interval":5000,
|
||||
"monType":1001010,
|
||||
"level":1,
|
||||
"mode":2,
|
||||
"name":"",
|
||||
"oscale":0,
|
||||
"team":2,
|
||||
"ai":0,
|
||||
"ai_search":2,
|
||||
"floatX":0,
|
||||
"floatY":0,
|
||||
"speedX":0,
|
||||
"speedY":2,
|
||||
"flashColor":"#ffffff",
|
||||
"flashAmount":0.7
|
||||
}
|
||||
},
|
||||
"showFace":{
|
||||
"type":"showFace",
|
||||
"sort":3,
|
||||
"des":"表情触发",
|
||||
"para":{
|
||||
"delay":1000,
|
||||
"face":4,
|
||||
"when":"born/hurt",
|
||||
"chance":1
|
||||
}
|
||||
},
|
||||
"monSteps":{
|
||||
"type":"monSteps",
|
||||
"sort":10,
|
||||
"des":"魔物路径器",
|
||||
"para":{
|
||||
"startTime":5000,
|
||||
"points":["point_team1_fore1"],
|
||||
"times":[5000],
|
||||
"addSpd":0.5,
|
||||
"addSpdTime":2000
|
||||
}
|
||||
},
|
||||
"hp":{
|
||||
"type":"hp",
|
||||
"des":"血量效果",
|
||||
"sort":5,
|
||||
"para":{
|
||||
"interval":5000,
|
||||
"hp":100,
|
||||
"mid":-1
|
||||
}
|
||||
},
|
||||
"skill":{
|
||||
"type":"skill",
|
||||
"des":"轮流释放技能",
|
||||
"sort":9,
|
||||
"para":{
|
||||
"startTime":5000,
|
||||
"skill":[1,2,1,1],
|
||||
"times":[5000,5000,5000,5000]
|
||||
}
|
||||
},
|
||||
"hunluanBoom":{
|
||||
"type":"hunluanBoom",
|
||||
"sort":8,
|
||||
"des":"死亡混乱BUFF",
|
||||
"para":{
|
||||
"time":3000,
|
||||
"w":250,
|
||||
"h":140,
|
||||
"pow":5,
|
||||
"atk":5,
|
||||
"exceptTeam":-1
|
||||
}
|
||||
},
|
||||
"deadBoom":{
|
||||
"type":"deadBoom",
|
||||
"sort":7,
|
||||
"des":"自爆BUFF",
|
||||
"para":{
|
||||
"w":200,
|
||||
"h":100,
|
||||
"pow":10,
|
||||
"atk":30,
|
||||
"exceptTeam":-1
|
||||
}
|
||||
},
|
||||
"hpArea":{
|
||||
"type":"hpArea",
|
||||
"sort":6,
|
||||
"des":"范围生命光环",
|
||||
"para":{
|
||||
"area":120,
|
||||
"hp":20,
|
||||
"interval":5000
|
||||
}
|
||||
},
|
||||
"buffMovie":{
|
||||
"type":"buffMovie",
|
||||
"sort":4.5,
|
||||
"des":"添加光环动画",
|
||||
"para":{
|
||||
"mov":"",
|
||||
"type":"none",
|
||||
"time":300000,
|
||||
"scale":1.2,
|
||||
"fps":30,
|
||||
"position":0,
|
||||
"floatX":0,
|
||||
"floatY":0,
|
||||
"front":false,
|
||||
"preCheck":false
|
||||
}
|
||||
},
|
||||
"buffMon":{
|
||||
"type":"buffMon",
|
||||
"sort":4,
|
||||
"des":"旧版buff",
|
||||
"para":{
|
||||
"interval":5000,
|
||||
"func":"buff_stun",
|
||||
"para":[1000],
|
||||
"mid":-1,
|
||||
"mov":["mov.BuffStun","stun",1000]
|
||||
}
|
||||
},
|
||||
"statusMov":{
|
||||
"type":"statusMov",
|
||||
"sort":13,
|
||||
"des":"改变状态动画",
|
||||
"para":{
|
||||
"mov":"walk",
|
||||
"delay":125
|
||||
}
|
||||
},
|
||||
"buff":{
|
||||
"type":"buff",
|
||||
"sort":0.5,
|
||||
"des":"添加buff",
|
||||
"para":{
|
||||
"interval":5000,
|
||||
"buff":"",
|
||||
"movType":1,
|
||||
"mid":-1
|
||||
}
|
||||
},
|
||||
"lockTarget":{
|
||||
"type":"lockTarget",
|
||||
"sort":14,
|
||||
"des":"锁定目标",
|
||||
"para":{"mid":"目标mid"}
|
||||
},
|
||||
"fixHurt":{
|
||||
"type":"fixHurt",
|
||||
"sort":15,
|
||||
"des":"伤害修改",
|
||||
"para":{
|
||||
"type":{"1001010":1.1},
|
||||
"element":{}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public function MonControllerType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
public static function getByType(type:String) : BaseMonController
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case "none":
|
||||
return new BaseMonController();
|
||||
case "add":
|
||||
return new MonControllerAdd();
|
||||
case "monMaker":
|
||||
return new MonControllerMonMaker();
|
||||
case "showFace":
|
||||
return new MonControllerShowFace();
|
||||
case "monSteps":
|
||||
return new MonControllerMonSteps();
|
||||
case "hp":
|
||||
return new MonControllerHp();
|
||||
case "skill":
|
||||
return new MonControllerMonSkill();
|
||||
case "hunluanBoom":
|
||||
return new MonControllerBosouBoom();
|
||||
case "deadBoom":
|
||||
return new MonControllerDeadBoom();
|
||||
case "hpArea":
|
||||
return new MonControllerHpArea();
|
||||
case "buffMovie":
|
||||
return new MonControllerBuffMovie();
|
||||
case "buffMon":
|
||||
return new MonControllerBuffMon();
|
||||
case "buff":
|
||||
return new MonControllerBuff();
|
||||
case "statusMov":
|
||||
return new MonControllerStatusMov();
|
||||
case "fixHurt":
|
||||
return new MonControllerFixHurt();
|
||||
case "lockTarget":
|
||||
return new MonControllerLockTarget();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static function buildByObject(o:Object, mon:BattleMon) : BaseMonController
|
||||
{
|
||||
var b:BaseMonController = getByType(o.type);
|
||||
b.buildByObject(o,mon);
|
||||
return b;
|
||||
}
|
||||
|
||||
public static function buildSunFire(mon:BattleMon, sunFire:int) : Object
|
||||
{
|
||||
var o:Object = {
|
||||
"type":"hpArea",
|
||||
"para":{
|
||||
"area":160,
|
||||
"hp":-sunFire,
|
||||
"interval":5000
|
||||
}
|
||||
};
|
||||
return buildByObject(o,mon);
|
||||
}
|
||||
|
||||
public static function buildMoonHeal(mon:BattleMon, moonHeal:int) : Object
|
||||
{
|
||||
var o:Object = {
|
||||
"type":"hpArea",
|
||||
"para":{
|
||||
"area":160,
|
||||
"hp":moonHeal,
|
||||
"interval":5000
|
||||
}
|
||||
};
|
||||
return buildByObject(o,mon);
|
||||
}
|
||||
|
||||
public static function buildSelfCure(mon:BattleMon, selfCure:Number) : Object
|
||||
{
|
||||
var o:Object = {
|
||||
"type":"hp",
|
||||
"para":{
|
||||
"interval":5000,
|
||||
"hp":selfCure
|
||||
}
|
||||
};
|
||||
return buildByObject(o,mon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,377 @@
|
||||
package net.pixvi.myr.element.battle.trigger
|
||||
{
|
||||
import net.pixvi.common.effect.effects.ShakeEffect;
|
||||
import net.pixvi.myr.battle.BattleGround;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
import net.pixvi.myr.element.battle.BattleTeamVo;
|
||||
import net.pixvi.myr.element.battle.trigger.triggereffect.BaseTriggerEffect;
|
||||
import net.pixvi.myr.element.battle.trigger.triggereffect.DelayTriggerEffect;
|
||||
import net.pixvi.myr.view.skill.BaseSkill;
|
||||
import net.pixvi.pfw.utils.ArrayUtil;
|
||||
import net.pixvi.pfw.utils.Caller;
|
||||
|
||||
public class BattleTrigger
|
||||
{
|
||||
|
||||
public var paraPool:Object;
|
||||
|
||||
public var ground:BattleGround;
|
||||
|
||||
public var effects:Array;
|
||||
|
||||
public var skillCount:Object = {};
|
||||
|
||||
public function BattleTrigger(ground:BattleGround)
|
||||
{
|
||||
super();
|
||||
this.ground = ground;
|
||||
effects = [];
|
||||
paraPool = {};
|
||||
}
|
||||
|
||||
public function checkEventTrigger(event:String, data:Object) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var trigger:Object = null;
|
||||
for(i = 0; i < ground.vo.triggers.length; )
|
||||
{
|
||||
trigger = ground.vo.triggers[i];
|
||||
if(trigger.type == "event" && trigger.para.event == event)
|
||||
{
|
||||
activity(trigger);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkSkillTrigger(team:int) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var trigger:Object = null;
|
||||
if(skillCount[team.toString()] == null)
|
||||
{
|
||||
skillCount[team.toString()] = 0;
|
||||
}
|
||||
skillCount[team.toString()]++;
|
||||
for(i = 0; i < ground.vo.triggers.length; )
|
||||
{
|
||||
trigger = ground.vo.triggers[i];
|
||||
if(trigger.type == "useSkill" && int(trigger.para.team) == team)
|
||||
{
|
||||
if(skillCount[team.toString()] % trigger.para.num == 0)
|
||||
{
|
||||
activity(trigger);
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkTimeTrigger() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var trigger:Object = null;
|
||||
for(i = 0; i < ground.vo.triggers.length; )
|
||||
{
|
||||
trigger = ground.vo.triggers[i];
|
||||
if(trigger.type == "time" && trigger.para.time * 1000 <= ground.battleTime.passTime)
|
||||
{
|
||||
activity(trigger);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkMonDeadTrigger(mon:BattleMon) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var trigger:Object = null;
|
||||
for(i = 0; i < ground.vo.triggers.length; )
|
||||
{
|
||||
trigger = ground.vo.triggers[i];
|
||||
if(trigger.type == "monDead" && trigger.para.mid == mon.mid)
|
||||
{
|
||||
activity(trigger);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function checkTeamWaveStart(team:int = 2, wave:int = 2) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var trigger:Object = null;
|
||||
for(i = 0; i < ground.vo.triggers.length; )
|
||||
{
|
||||
trigger = ground.vo.triggers[i];
|
||||
if(trigger.type == "waveStart" && trigger.para.team == team && trigger.para.wave == wave)
|
||||
{
|
||||
activity(trigger);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function activity(vo:Object) : void
|
||||
{
|
||||
var i:int = 0;
|
||||
for(i = 0; i < vo.effects.length; )
|
||||
{
|
||||
effect(vo.effects[i]);
|
||||
i++;
|
||||
}
|
||||
var trigger:Object = ArrayUtil.getElementByValue(ground.vo.triggers,"id",vo.id);
|
||||
if(trigger != null && trigger.para.loop != null && trigger.para.loop == true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ArrayUtil.removeByValue(ground.vo.triggers,"id",vo.id);
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
for each(var e:BaseTriggerEffect in effects)
|
||||
{
|
||||
e.pause();
|
||||
}
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
for each(var e:BaseTriggerEffect in effects)
|
||||
{
|
||||
e.resume();
|
||||
}
|
||||
}
|
||||
|
||||
public function stop() : void
|
||||
{
|
||||
for each(var e:BaseTriggerEffect in effects)
|
||||
{
|
||||
e.stop();
|
||||
}
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
var i:int = 0;
|
||||
var effect:BaseTriggerEffect = null;
|
||||
for(i = 0; i < effects.length; )
|
||||
{
|
||||
effect = effects[i];
|
||||
if(effect.completed)
|
||||
{
|
||||
effects.splice(i,1);
|
||||
i--;
|
||||
}
|
||||
else
|
||||
{
|
||||
effect.step();
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public function effect(vo:Object) : void
|
||||
{
|
||||
var mon:BattleMon = null;
|
||||
var o:Boolean = false;
|
||||
var eff:DelayTriggerEffect = null;
|
||||
var findMons:Array = null;
|
||||
var findmon:BattleMon = null;
|
||||
findMons = null;
|
||||
findmon = null;
|
||||
mon = null;
|
||||
var m:BattleMon = null;
|
||||
var shake:ShakeEffect = null;
|
||||
m = null;
|
||||
m = null;
|
||||
var con:Object = null;
|
||||
switch(vo.type)
|
||||
{
|
||||
case "none":
|
||||
return;
|
||||
case "monSkill":
|
||||
mon = ground.findMonByMid(vo.para.mid);
|
||||
if(mon != null && mon["skill_" + vo.para.skill] != null)
|
||||
{
|
||||
o = Boolean(mon["skill_" + vo.para.skill].startShow);
|
||||
if(vo.para.startShow != null && vo.para.startShow != -1)
|
||||
{
|
||||
if(vo.para.startShow == 0)
|
||||
{
|
||||
mon["skill_" + vo.para.skill].startShow = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
mon["skill_" + vo.para.skill].startShow = true;
|
||||
}
|
||||
}
|
||||
if(vo.para.delay > 0)
|
||||
{
|
||||
mon.buff.buff_stun(vo.para.delay);
|
||||
if(vo.para.mov != "")
|
||||
{
|
||||
mon.buff.addBuffMov(vo.para.mov,vo.para.type,vo.para.delay);
|
||||
}
|
||||
eff = new DelayTriggerEffect(vo);
|
||||
eff.init(vo.para.delay,delayChangeSkillShow,[mon["skill_" + vo.para.skill],o],mon);
|
||||
effects.push(eff);
|
||||
}
|
||||
else
|
||||
{
|
||||
mon["skill_" + vo.para.skill].activity();
|
||||
mon["skill_" + vo.para.skill].startShow = o;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "story":
|
||||
ground.storyStart(vo.para.script);
|
||||
break;
|
||||
case "buff":
|
||||
findMons = [];
|
||||
if(vo.para.mid is Array)
|
||||
{
|
||||
for each(var mids:int in vo.para.mid)
|
||||
{
|
||||
if(ground.findMonByMid(mids) != null)
|
||||
{
|
||||
findMons.push(ground.findMonByMid(mids));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
findmon = ground.findMonByMid(vo.para.mid);
|
||||
if(findmon != null)
|
||||
{
|
||||
findMons.push(findmon);
|
||||
}
|
||||
}
|
||||
for each(var resMon:BattleMon in findMons)
|
||||
{
|
||||
resMon.buff.activityByObjectType2(vo.para);
|
||||
}
|
||||
break;
|
||||
case "monBuff":
|
||||
findMons = [];
|
||||
if(vo.para.mid is Array)
|
||||
{
|
||||
for each(mids in vo.para.mid)
|
||||
{
|
||||
if(ground.findMonByMid(mids) != null)
|
||||
{
|
||||
findMons.push(ground.findMonByMid(mids));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
findmon = ground.findMonByMid(vo.para.mid);
|
||||
if(findmon != null)
|
||||
{
|
||||
findMons.push(findmon);
|
||||
}
|
||||
}
|
||||
for each(resMon in findMons)
|
||||
{
|
||||
resMon.buff.activityByObject(vo.para);
|
||||
}
|
||||
break;
|
||||
case "buffMov":
|
||||
mon = ground.findMonByMid(vo.para.mid);
|
||||
if(mon != null)
|
||||
{
|
||||
mon.buff.addBuffMov(vo.para.mov,vo.para.type,vo.para.time,vo.para.scale,vo.para.fps,vo.para.position,vo.para.floatX,vo.para.floatY,vo.para.front,vo.para.stopMovie);
|
||||
}
|
||||
break;
|
||||
case "event":
|
||||
checkEventTrigger(vo.para.event,vo.para.data);
|
||||
break;
|
||||
case "monJoin":
|
||||
m = ground.findMonByMid(vo.para.mid);
|
||||
if(m != null)
|
||||
{
|
||||
m.forceToStage = true;
|
||||
}
|
||||
break;
|
||||
case "unlockWave":
|
||||
(ground.vo.teamDic[vo.para.team] as BattleTeamVo).waveUnlock[vo.para.wave] = true;
|
||||
break;
|
||||
case "shake":
|
||||
if(vo.para.target == "all")
|
||||
{
|
||||
shake = new ShakeEffect(vo.para.xd,vo.para.yd,vo.para.damping);
|
||||
if(vo.para.delay != null)
|
||||
{
|
||||
shake.startEffect(ground);
|
||||
}
|
||||
else
|
||||
{
|
||||
Caller.delayCall(shake.startEffect,vo.para.delay,1,[ground]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m = ground.findMonByMid(vo.para.target);
|
||||
if(m != null)
|
||||
{
|
||||
shake = new ShakeEffect(vo.para.xd,vo.para.yd,vo.para.damping);
|
||||
if(vo.para.delay != null)
|
||||
{
|
||||
Caller.delayCall(shake.startEffect,vo.para.delay,1,[ground]);
|
||||
}
|
||||
else
|
||||
{
|
||||
shake.startEffect(ground);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "showFace":
|
||||
if(vo.para.target == "team")
|
||||
{
|
||||
for each(m in ground.monsters)
|
||||
{
|
||||
if(m.team == vo.para.id)
|
||||
{
|
||||
m.showFace(vo.para.face,vo.para.time);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(vo.para.target == "mon")
|
||||
{
|
||||
m = ground.findMonByMid(vo.para.id);
|
||||
if(m != null)
|
||||
{
|
||||
m.showFace(vo.para.face,vo.para.time);
|
||||
}
|
||||
}
|
||||
else if(vo.para.target == "all")
|
||||
{
|
||||
for each(m in ground.monsters)
|
||||
{
|
||||
m.showFace(vo.para.face,vo.para.time);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "startController":
|
||||
ArrayUtil.getElementByValue(ground.controllers,"id",vo.para.id).activited = true;
|
||||
break;
|
||||
case "stopController":
|
||||
con = ArrayUtil.getElementByValue(ground.controllers,"id",vo.para.id);
|
||||
if(con != null)
|
||||
{
|
||||
con.activited = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function delayChangeSkillShow(sk:BaseSkill, show:Boolean) : void
|
||||
{
|
||||
sk.activity();
|
||||
sk.startShow = show;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package net.pixvi.myr.element.battle.trigger
|
||||
{
|
||||
public class BattleTriggerType
|
||||
{
|
||||
|
||||
public static const NONE:String = "none";
|
||||
|
||||
public static const TIME:String = "time";
|
||||
|
||||
public static const EVENT:String = "event";
|
||||
|
||||
public static const MON_DEAD:String = "monDead";
|
||||
|
||||
public static const WAVE_START:String = "waveStart";
|
||||
|
||||
public static const USE_SKILL:String = "useSkill";
|
||||
|
||||
public static var dic:Object = {
|
||||
"none":{
|
||||
"type":"none",
|
||||
"des":"无",
|
||||
"para":{}
|
||||
},
|
||||
"time":{
|
||||
"type":"time",
|
||||
"des":"时间触发",
|
||||
"para":{"time":5}
|
||||
},
|
||||
"event":{
|
||||
"type":"event",
|
||||
"des":"事件触发",
|
||||
"para":{"event":"触发事件"}
|
||||
},
|
||||
"monDead":{
|
||||
"type":"monDead",
|
||||
"des":"死亡触发",
|
||||
"para":{"mid":10000}
|
||||
},
|
||||
"waveStart":{
|
||||
"type":"waveStart",
|
||||
"des":"进入波次触发",
|
||||
"para":{
|
||||
"team":2,
|
||||
"wave":2
|
||||
}
|
||||
},
|
||||
"useSkill":{
|
||||
"type":"useSkill",
|
||||
"des":"每num个技能时",
|
||||
"para":{
|
||||
"team":1,
|
||||
"num":1
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public function BattleTriggerType()
|
||||
{
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package net.pixvi.myr.element.battle.trigger.triggereffect
|
||||
{
|
||||
public class BaseTriggerEffect
|
||||
{
|
||||
|
||||
public var id:String;
|
||||
|
||||
public var type:String;
|
||||
|
||||
public var para:Object;
|
||||
|
||||
public var completed:Boolean = false;
|
||||
|
||||
public function BaseTriggerEffect(o:Object)
|
||||
{
|
||||
super();
|
||||
this.id = o.id;
|
||||
this.type = o.type;
|
||||
this.para = o.para;
|
||||
}
|
||||
|
||||
public function start() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function complete() : void
|
||||
{
|
||||
this.completed = true;
|
||||
}
|
||||
|
||||
public function step() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function pause() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function stop() : void
|
||||
{
|
||||
}
|
||||
|
||||
public function resume() : void
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package net.pixvi.myr.element.battle.trigger.triggereffect
|
||||
{
|
||||
import net.pixvi.common.utils.Cooldowner;
|
||||
import net.pixvi.myr.battle.view.BattleMon;
|
||||
|
||||
public class DelayTriggerEffect extends BaseTriggerEffect
|
||||
{
|
||||
|
||||
public var func:Function;
|
||||
|
||||
public var funcpara:Array;
|
||||
|
||||
public var timer:Cooldowner;
|
||||
|
||||
public var mondeadcheck:BattleMon;
|
||||
|
||||
public function DelayTriggerEffect(o:Object)
|
||||
{
|
||||
super(o);
|
||||
}
|
||||
|
||||
public function init(time:int = 1000, func:Function = null, para:Array = null, mondeadcheck:BattleMon = null) : void
|
||||
{
|
||||
timer = new Cooldowner(time);
|
||||
timer.activity();
|
||||
this.mondeadcheck = mondeadcheck;
|
||||
this.func = func;
|
||||
this.funcpara = para;
|
||||
}
|
||||
|
||||
override public function step() : void
|
||||
{
|
||||
if(timer.cooldown)
|
||||
{
|
||||
complete();
|
||||
}
|
||||
}
|
||||
|
||||
override public function pause() : void
|
||||
{
|
||||
timer.pause();
|
||||
}
|
||||
|
||||
override public function resume() : void
|
||||
{
|
||||
timer.resume();
|
||||
}
|
||||
|
||||
override public function stop() : void
|
||||
{
|
||||
timer.pause();
|
||||
}
|
||||
|
||||
override public function complete() : void
|
||||
{
|
||||
if(mondeadcheck == null || !mondeadcheck.monVo.dead)
|
||||
{
|
||||
func.apply(this,funcpara);
|
||||
}
|
||||
super.complete();
|
||||
mondeadcheck = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user