public override void clear() { base.clear(); this.shallow = null; Utils.clearObject(this.seekRange); this.seekRange = null; this.lockTarget = null; this.seekTarget = null; this.seekData = null; this.owner = null; }
private void createBullet() { object[] bullets = (object[])this._step["bullets"]; //return; Dictionary <string, object> global = this._step.ContainsKey("global") ? (Dictionary <string, object>) this._step["global"] : null; MediatorSystem.timeStart("skillCreateBullet"); BulletShallow shallow = null; if (this._step.ContainsKey("shallow")) { shallow = new BulletShallow(this._map).init(); shallow.shallow = Convert.ToDouble(this._step["shallow"]); } for (int i = 0, len = bullets.Length; i < len; i++) { //MediatorSystem.timeStart("clone"); Dictionary <string, object> bulletData = (Dictionary <string, object>)bullets[i]; //当前的字典 合并到子弹里。 if (null != global) { Dictionary <string, object> temp = (Dictionary <string, object>)Utils.clone(global); Utils.union1(temp, bulletData); bulletData = temp; } //MediatorSystem.getRunTime("clone"); BulletEntity bullet = this._player.map.createFightEntity(ConfigConstant.ENTITY_BULLET) as BulletEntity; bullet.lockTarget = this._lockTarget; bullet.owner = this._player; bullet.shallow = shallow; bullet.initConfig(bulletData); } MediatorSystem.getRunTime("skillCreateBullet", bullets.Length); }
public override void setData(Dictionary <string, object> data) { //this._lifeTime = Convert.ToSingle(data["lifeTime"]); if (data.ContainsKey("owner")) { this.owner = (PersonEntity)this._map.getNetObject((int)(data["owner"])); } this._speed = (int)(data["speed"]); this._accSpeed = (int)(data["accSpeed"]); this.atk = (int)(data["atk"]); this._aoe = (int)(data["aoe"]); this.backForce = (int)(data["backForce"]); this._lifeTime = (int)(data["lifeTime"]); this._preTime = (int)(data["preTime"]); if (data.ContainsKey("seekData")) { this.seekData = (Dictionary <string, object>)data["seekData"]; } if (data.ContainsKey("seekTarget")) { this.seekTarget = (PersonEntity)this._map.getNetObject((int)(data["seekTarget"])); } if (data.ContainsKey("lockTarget")) { this.lockTarget = (PersonEntity)this._map.getNetObject((int)(data["lockTarget"])); } if (data.ContainsKey("seekRange")) { this.seekRange = (GeomBase)this._map.getNetObject((int)(data["seekRange"])); } if (data.ContainsKey("shallow")) { this.shallow = (BulletShallow)this._map.getNetObject((int)(data["shallow"])); } if (data.ContainsKey("hitAction")) { this._hitAction = (IntervalAction)this._map.getNetObject((int)(data["hitAction"])); this._hitAction.intervalHandler = this.checkHit; } if (data.ContainsKey("bombAction")) { this._bombAction = (IntervalAction)this._map.getNetObject((int)(data["bombAction"])); this._bombAction.intervalHandler = this.bomb; } this.hitList = new List <object>((object[])data["hitList"]).ConvertAll <PersonEntity>((id) => { return((PersonEntity)this._map.getNetObject((int)id)); }); this.bangCount = (int)data["bangCount"]; this.bangRadiusMax = (int)data["bangRadiusMax"]; this.bangRadiusMin = (int)data["bangRadiusMin"]; this.zoomCount = (int)data["zoomCount"]; this.zoomRadius = (int)data["zoomRadius"]; this.zoomScale = Convert.ToDouble(data["zoomScale"]); this.zoomDamage = (int)data["zoomDamage"]; this.zoomStun = (int)data["zoomStun"]; this.stun = (int)data["stun"]; base.setData(data); this.bangRateMax = Convert.ToDouble(this._data["bangRateMax"]); this.bangRateMin = Convert.ToDouble(this._data["bangRateMin"]); this.checkBarrier = Utils.equal(this._data, "checkBarrier", 1); this.isFree = !Utils.equal(this._data, "posTarget", 1); }