| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- local BuffEntity = class("BuffEntity")
- function BuffEntity:ctor(data)
- self._data = data
-
- self._actorID = data.actorID
- self._buffID = data.buffID
- self._param = data.param
- self._ol = data.ol
- if self._buffID > 10000 then
- self._endTime = tonumber(data.param) or GetServerTime()
- else
- self._endTime = (tonumber(data.param) or 0) + GetServerTime()
- end
-
- self._autoRemove= data.autoRemove
- self._isInvalid = false
- self._visible = true
- -- 检测是不是副驾的玩家 副驾玩家的buff特效都不显示出来
- local actor = global.actorManager:GetActor(self._actorID)
- if actor and actor:IsPlayer() and actor:IsHoreseCopilot() then
- self._visible = false
- end
- end
- function BuffEntity:OnEnter()
- end
- function BuffEntity:OnExit()
- end
- function BuffEntity:UpdateSfxDir()
- return false
- end
- function BuffEntity:Tick(dt)
- if self._autoRemove then
- if GetServerTime() > self._endTime then
- self:disable()
- end
- end
- end
- function BuffEntity:IsInvalid()
- return self._isInvalid
- end
- function BuffEntity:disable()
- self._isInvalid = true
- end
- function BuffEntity:abort()
- self:disable()
- end
- function BuffEntity:GetActorID()
- return self._actorID
- end
- function BuffEntity:GetBuffID()
- return self._buffID
- end
- function BuffEntity:GetData()
- return self._data
- end
- function BuffEntity:GetEndTime()
- return self._endTime
- end
- function BuffEntity:GetParam()
- return self._param
- end
- function BuffEntity:IsAllowAnimUpdate()
- return true
- end
- function BuffEntity:UpdatePresent()
- return false
- end
- function BuffEntity:OnActorStuck()
- return false
- end
- function BuffEntity:UpdateParam(param)
- self._param = param
- if self._buffID > 10000 then
- self._endTime = tonumber(param) or GetServerTime()
- else
- self._endTime = (tonumber(param) or 0) + GetServerTime()
- end
- end
- function BuffEntity:UpdateOl(ol)
- if ol then
- self._ol = ol
- end
- end
- function BuffEntity:GetOl()
- return self._ol
- end
- function BuffEntity:setPosition(x, y)
- end
- function BuffEntity:setVisible(visible)
- end
- function BuffEntity:updatePosition()
- end
- return BuffEntity
|