gameActorMonster.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. local gameActorMoveable = require( "actor/gameActorMoveable")
  2. local gameActorMonster = class('gameActorMonster', gameActorMoveable)
  3. local gameActorStateMonsterIdle = require( "actor/gameActorStateMonsterIdle" )
  4. local gameActorStateMonsterWalk = require( "actor/gameActorStateMonsterWalk" )
  5. local gameActorStateMonsterAttack = require( "actor/gameActorStateMonsterAttack" )
  6. local gameActorStateMonsterSkill = require( "actor/gameActorStateMonsterSkill" )
  7. local gameActorStateMonsterDie = require( "actor/gameActorStateMonsterDie" )
  8. local gameActorStateMonsterStuck = require( "actor/gameActorStateMonsterStuck" )
  9. local gameActorStateMonsterBorn = require( "actor/gameActorStateMonsterBorn" )
  10. local gameActorStateMonsterDeath = require( "actor/gameActorStateMonsterDeath" )
  11. local gameActorStateMonsterChangeShape = require( "actor/gameActorStateMonsterChangeShape" )
  12. local gameActorStateMonsterCave = require( "actor/gameActorStateMonsterCave" )
  13. local gameActorStateMonsterUnknown1 = require( "actor/gameActorStateMonsterUnknown1" )
  14. local gameActorStateMonsterUnknown2 = require( "actor/gameActorStateMonsterUnknown2" )
  15. local gameActorStateMonsterUnknown3 = require( "actor/gameActorStateMonsterUnknown3" )
  16. local gameActorStateMonsterOnPush = require( "actor/gameActorStateMonsterOnPush" )
  17. local gameActorStateMonsterTeleport = require( "actor/gameActorStateMonsterTeleport" )
  18. local optionsUtils = requireProxy( "optionsUtils" )
  19. local proxyUtils = requireProxy("proxyUtils")
  20. --绑定特效
  21. local AttachAnimMap = {
  22. [196] = 197, --黄泉教主
  23. [901] = 9011, --沙巴克城墙
  24. [902] = 9012, --沙巴克城墙
  25. [903] = 9013, --沙巴克城墙
  26. [904] = 9011, --沙巴克城墙
  27. [905] = 9012, --沙巴克城墙
  28. [906] = 9013, --沙巴克城墙
  29. [256] = 257, --雪域魔王
  30. [325] = 3251, --狐月电眼
  31. [326] = 3261, --狐月风眼
  32. [327] = 3271, --狐月天竺
  33. [172] = 173, --月灵
  34. [342] = 343, --黄金龙
  35. }
  36. local mmo = global.MMO
  37. local mapActAnim = {
  38. [mmo.ACTION_IDLE] = mmo.ANIM_IDLE,
  39. [mmo.ACTION_WALK] = mmo.ANIM_WALK,
  40. [mmo.ACTION_ATTACK] = mmo.ANIM_ATTACK,
  41. [mmo.ACTION_SKILL] = mmo.ANIM_SKILL,
  42. [mmo.ACTION_DIE] = mmo.ANIM_DIE,
  43. [mmo.ACTION_RUN] = mmo.ANIM_RUN,
  44. [mmo.ACTION_STUCK] = mmo.ANIM_STUCK,
  45. [mmo.ACTION_BORN] = mmo.ANIM_BORN,
  46. [mmo.ACTION_DEATH] = mmo.ANIM_DEATH,
  47. [mmo.ACTION_CHANGESHAPE] = mmo.ANIM_CHANGESHAPE,
  48. [mmo.ACTION_CAVE] = mmo.ANIM_BORN,
  49. [mmo.ACTION_UNKNOWN1] = mmo.ANIM_UNKNOWN1,
  50. [mmo.ACTION_UNKNOWN2] = mmo.ANIM_UNKNOWN2,
  51. [mmo.ACTION_UNKNOWN3] = mmo.ANIM_UNKNOWN3,
  52. [mmo.ACTION_ONPUSH] = mmo.ANIM_WALK,
  53. [mmo.ACTION_TELEPORT] = mmo.ANIM_IDLE,
  54. }
  55. local isStateInited = false
  56. local actState = {}
  57. --动作方向
  58. local fixAnimDirection = {
  59. [3] = 0, --宝箱
  60. [4] = 0,
  61. [7] = 0, --宝箱
  62. [8] = 0, --宝箱
  63. [41] = 0, --角蝇
  64. [132] = 0, --幻影蜘蛛
  65. [131] = 0, --赤月恶魔
  66. [140] = 0, --触龙神
  67. [141] = 0, --树
  68. [216] = 0, --魔龙石碑
  69. [324] = 0, --九尾魂石
  70. [325] = 0,
  71. [327] = 0, --狐月天珠
  72. [329] = 0,
  73. [801] = 0, --火龙守护兽1
  74. [802] = 0, --火龙守护兽2
  75. [803] = 0, --卧龙山庄 采集物
  76. [804] = 0, --卧龙山庄 采集物
  77. [805] = 0, --卧龙山庄 采集物
  78. [806] = 0, --卧龙山庄 采集物
  79. [807] = 0, --卧龙山庄 采集物
  80. [901] = 0, --城墙
  81. [902] = 0, --城墙
  82. [903] = 0, --城墙
  83. [904] = 0, --城墙
  84. [905] = 0, --城墙
  85. [906] = 0, --城墙
  86. [10] = { --食人花
  87. [mmo.ANIM_IDLE] = 0,
  88. [mmo.ANIM_BORN] = 0,
  89. },
  90. [63] = { --祖玛教主
  91. [mmo.ANIM_BORN] = 0,
  92. },
  93. [800] = { --火龙神
  94. [mmo.ANIM_IDLE] = 0,
  95. },
  96. }
  97. function gameActorMonster:getMonsterActionState(act)
  98. if act > mmo.ACTION_MAX then
  99. return nil
  100. end
  101. if not isStateInited then
  102. actState[mmo.ACTION_IDLE] = gameActorStateMonsterIdle.new()
  103. actState[mmo.ACTION_WALK] = gameActorStateMonsterWalk.new()
  104. actState[mmo.ACTION_ATTACK] = gameActorStateMonsterAttack.new()
  105. actState[mmo.ACTION_SKILL] = gameActorStateMonsterSkill.new()
  106. actState[mmo.ACTION_DIE] = gameActorStateMonsterDie.new()
  107. actState[mmo.ACTION_STUCK] = gameActorStateMonsterStuck.new()
  108. actState[mmo.ACTION_BORN] = gameActorStateMonsterBorn.new()
  109. actState[mmo.ACTION_DEATH] = gameActorStateMonsterDeath.new()
  110. actState[mmo.ACTION_CHANGESHAPE] = gameActorStateMonsterChangeShape.new()
  111. actState[mmo.ACTION_CAVE] = gameActorStateMonsterCave.new()
  112. actState[mmo.ACTION_UNKNOWN1] = gameActorStateMonsterUnknown1.new()
  113. actState[mmo.ACTION_UNKNOWN2] = gameActorStateMonsterUnknown2.new()
  114. actState[mmo.ACTION_UNKNOWN3] = gameActorStateMonsterUnknown3.new()
  115. actState[mmo.ACTION_ONPUSH] = gameActorStateMonsterOnPush.new()
  116. actState[mmo.ACTION_TELEPORT] = gameActorStateMonsterTeleport.new()
  117. isStateInited = true
  118. end
  119. return actState[act]
  120. end
  121. function gameActorMonster:ctor()
  122. gameActorMonster.super.ctor(self)
  123. end
  124. function gameActorMonster:init()
  125. gameActorMonster.super.init(self)
  126. self.mActionHandler = nil
  127. self.mCurrentState = self:getMonsterActionState( self.mAction )
  128. self.mCurrentActT = 0.0
  129. self.mMoveOrient = cc.p( 0.0, 0.0 )
  130. self.mTargePos = cc.p( 0.0, 0.0 )
  131. self.mDistanceToTarget = 0.0
  132. self.mClothID = nil
  133. self.mFeatureDirty = false
  134. self.mAnimAct = mmo.ANIM_IDLE
  135. self.mIsAnimNeedToUpdate = false
  136. self.mStopAnimFrameIndex = nil
  137. self.mCurrAvatarNode = nil
  138. self.mHP = 0
  139. self.mMaxHP = 0
  140. self.mMP = 0
  141. self.mMaxMP = 0
  142. self.mHUDUI = {}
  143. self.mLevel = 0
  144. self.mOwnerID = -1
  145. self.mOwnerName = ""
  146. self.mStoneMode = false
  147. self.mRaceServer = 0 -- 服务器race字段,只有怪物有,目前用以区分怪物是否可挖掘
  148. self.mRaceImg = 0
  149. self.mIsSleepInCave = false -- 在洞穴中,钻回洞穴有个过渡,该变量表示已经完全钻回去
  150. end
  151. function gameActorMonster:destory()
  152. gameActorMonster.super.destory(self)
  153. -- remove hud
  154. global.HUDManager:RemoveActorAllHUD( self.mID )
  155. end
  156. function gameActorMonster:Tick(dt)
  157. gameActorMonster.super.Tick(self, dt)
  158. self.mCurrentState:Tick( dt, self )
  159. if self.mFeatureDirty then
  160. self.mFeatureDirty = false
  161. self:checkFeature()
  162. end
  163. if self.mIsAnimNeedToUpdate then
  164. self:updateAnimation()
  165. self.mIsAnimNeedToUpdate = false
  166. end
  167. end
  168. function gameActorMonster:setPosition(x, y)
  169. gameActorMonster.super.setPosition(self, x, y)
  170. -- refresh zOrder
  171. if self.mAction == mmo.ACTION_DIE then
  172. self:GetNode():setLocalZOrder( math.floor(-y) + self:GetAdditionZorder() + mmo.DieAddZorder )
  173. else
  174. self:GetNode():setLocalZOrder( math.floor(-y) + self:GetAdditionZorder() )
  175. end
  176. -- update hud pos
  177. local hudTop = self:GetHUDTop()
  178. global.HUDManager:setPosition( self.mID, x, y + hudTop )
  179. -- update buff pos
  180. global.BuffManager:setPosition(self:GetID(), x, y)
  181. global.ActorEffectManager:setPosition(self:GetID(), x, y)
  182. end
  183. function gameActorMonster:SetMoveTo( pos )
  184. self.mMoveTo = pos
  185. return 1
  186. end
  187. function gameActorMonster:SetDirection(dir)
  188. gameActorMonster.super.SetDirection(self, dir)
  189. local isUpdate = (self.mOrient ~= dir)
  190. if isUpdate then self:dirtyAnimFlag() end
  191. end
  192. function gameActorMonster:SetAction(newAction, isTerminate)
  193. if nil == isTerminate then isTerminate = false end
  194. local stateNew = self:getMonsterActionState( newAction )
  195. local stateOld = self.mCurrentState
  196. local oldAction = self.mAction
  197. if self.mCurrentState:ChangeState( stateNew, self, isTerminate ) then
  198. if 0 ~= stateOld then
  199. stateOld:OnExit( self )
  200. end
  201. self.mAction = newAction
  202. if 0 ~= stateNew then
  203. stateNew:OnEnter( self )
  204. end
  205. if oldAction ~= newAction then
  206. local actAnim = mapActAnim[newAction]
  207. self:SetAnimAct( actAnim )
  208. end
  209. end
  210. end
  211. function gameActorMonster:SetAnimAct(newAnim)
  212. if self.mAnimAct ~= newAnim then
  213. self.mAnimAct = newAnim
  214. -- in die anim, zOrder is lowest
  215. if newAnim == mmo.ANIM_DIE then
  216. self:GetNode():setLocalZOrder( -self:GetNode():getPositionY() + self:GetAdditionZorder() + mmo.DieAddZorder )
  217. end
  218. self:dirtyAnimFlag()
  219. end
  220. end
  221. function gameActorMonster:SetName(name)
  222. self.mName = name
  223. end
  224. function gameActorMonster:SetHPHUD(HP, maxHP)
  225. local preHp = self.mHP
  226. self:SetHP(HP)
  227. self:SetMaxHP(maxHP)
  228. self:SetKeyValue(mmo.HUD_Hp_Full, self.mHP >= self.mMaxHP and self.mMaxHP > 0)
  229. self:SetKeyValue(mmo.HUD_Hp_Null, self.mHP < 1 or self.mMaxHP < 1)
  230. local bar = self.mHUDUI[mmo.HUDHPUI_BAR]
  231. if not bar then
  232. return false
  233. end
  234. if preHp > HP then
  235. self:SetKeyValue(mmo.HUD_BAR_SHOW_FULL_HP, true)
  236. end
  237. local hpPerc = HP / maxHP
  238. if global.ConstantConfig.showFewHp == 1 and not self:GetValueByKey(mmo.HUD_BAR_SHOW_FULL_HP) then
  239. hpPerc = 1
  240. end
  241. global.HUDManager:SetHUDBarPercent( bar, hpPerc )
  242. optionsUtils:InitHUDVisibleValue(self, mmo.HUD_HPBAR_VISIBLE)
  243. optionsUtils:InitHUDVisibleValue(self, mmo.HUD_HMPLabel_VISIBLE)
  244. optionsUtils:CheckHUDHpBarVisible(self)
  245. global.HUDHPManager:Update(self)
  246. end
  247. function gameActorMonster:SetShieldHUD(MP, maxMP)
  248. self:SetMP( MP )
  249. self:SetMaxMP( maxMP )
  250. if maxMP <= 0 then
  251. return nil
  252. end
  253. if not self.mHUDUI[mmo.HUDMPUI_BAR] then
  254. return
  255. end
  256. local bar = self.mHUDUI[mmo.HUDMPUI_BAR]
  257. local percent = MP / maxMP
  258. global.HUDManager:SetHUDBarPercent( bar, percent )
  259. optionsUtils:InitHUDVisibleValue(self, mmo.HUD_MPBAR_VISIBLE)
  260. optionsUtils:CheckHUDMpBarVisible(self)
  261. end
  262. function gameActorMonster:SetHP(HP)
  263. self.mHP = HP or 0
  264. end
  265. function gameActorMonster:SetMaxHP(maxHP)
  266. self.mMaxHP = maxHP or 0
  267. end
  268. function gameActorMonster:GetHP()
  269. return self.mHP
  270. end
  271. function gameActorMonster:GetMaxHP()
  272. return self.mMaxHP
  273. end
  274. function gameActorMonster:SetMP(MP)
  275. self.mMP = MP or 0
  276. end
  277. function gameActorMonster:SetMaxMP(maxMP)
  278. self.mMaxMP = maxMP or 0
  279. end
  280. function gameActorMonster:GetMP()
  281. return self.mMP
  282. end
  283. function gameActorMonster:GetMaxMP()
  284. return self.mMaxMP
  285. end
  286. function gameActorMonster:onSequAnimLoadCompleted(actorID, animID, seqAnim)
  287. local _this = global.actorManager:GetActor(actorID)
  288. if nil == _this then
  289. return
  290. end
  291. -- Refresh monster name label hud top
  292. local p = cc.p( _this:getPosition() )
  293. global.HUDManager:setPosition( _this:GetID(), p.x, p.y + seqAnim:GetHUDTop() )
  294. -- sync Total Duration
  295. local animAct = seqAnim:GetCurrAnimAct()
  296. local elapsed = seqAnim:GetElapsed() or 0
  297. _this.mCurrentState:OnAnimLoadCompleted(_this, animAct, elapsed)
  298. end
  299. function gameActorMonster:InitParam( param )
  300. self.mCurrActorNode = cc.Node:create()
  301. self.mCurrAvatarNode = cc.Node:create()
  302. self.mCurrActorNode:addChild( self.mCurrAvatarNode )
  303. self.mCurrAvatarNode:setTag( mmo.MONSTER_AVATAR_TAG )
  304. self.mCurrAvatarNode:setPosition( mmo.PLAYER_AVATAR_OFFSET )
  305. self.mCurrMountNode = cc.Node:create()
  306. self.mCurrActorNode:addChild(self.mCurrMountNode)
  307. self.mCurrMountNode:setTag(mmo.MONSTER_MOUNT_TAG)
  308. self.mCurrMountNode:setPosition(mmo.PLAYER_AVATAR_OFFSET)
  309. return 1
  310. end
  311. function gameActorMonster:SetClothID(id)
  312. self.mClothID = id
  313. end
  314. function gameActorMonster:dirtyFeature()
  315. self.mFeatureDirty = true
  316. end
  317. function gameActorMonster:checkFeature()
  318. self:updateCloth()
  319. end
  320. function gameActorMonster:updateCloth()
  321. local function loadCallback( animID, seqAnim )
  322. self:onSequAnimLoadCompleted( self:GetID(), animID, seqAnim )
  323. end
  324. if self.mAnimation then
  325. self.mAnimation:removeFromParent()
  326. self.mAnimation = nil
  327. end
  328. if self.mAttachAnim then
  329. self.mAttachAnim:removeFromParent()
  330. self.mAttachAnim = nil
  331. end
  332. -- 简装
  333. local ID = optionsUtils:get_MonsterSimpleDress(self) or self.mClothID
  334. self.mAnimation = global.FrameAnimManager:CreateActorMonsterAnim( ID, self.mAnimAct, loadCallback )
  335. self.mCurrAvatarNode:addChild( self.mAnimation )
  336. self.mAnimation:setTag( mmo.MONSTER_BODY_TAG )
  337. local attachAnimID = AttachAnimMap[ID]
  338. if attachAnimID then
  339. self.mAttachAnim = global.FrameAnimManager:CreateActorMonsterAnim( attachAnimID, self.mAnimAct )
  340. self.mCurrAvatarNode:addChild( self.mAttachAnim )
  341. -- 特殊处理月灵
  342. if ID == 172 then
  343. self.mAttachAnim:setLocalZOrder(-1)
  344. end
  345. end
  346. -- Refresh npc name label hud top
  347. local pos = self:getPosition()
  348. global.HUDManager:setPosition( self:GetID(), pos.x, pos.y + self:GetHUDTop() )
  349. self:dirtyAnimFlag()
  350. end
  351. function gameActorMonster:stopAnimToFrame( frameIndex )
  352. self.mStopAnimFrameIndex = frameIndex
  353. end
  354. function gameActorMonster:StopAllAnimation( frameIndex )
  355. local animDir = self:getFixAnimDir() or self.mOrient
  356. if self.mAnimation then
  357. self.mAnimation:Stop( frameIndex, self.mAnimAct, animDir )
  358. end
  359. if self.mAttachAnim then
  360. self.mAttachAnim:Stop( frameIndex, self.mAnimAct, animDir )
  361. end
  362. end
  363. function gameActorMonster:updateAnimation()
  364. local isLoop = self.mAnimAct == mmo.ANIM_IDLE or self.mAnimAct == mmo.ANIM_WALK
  365. local animDir = self:getFixAnimDir() or self.mOrient
  366. -- speed
  367. local speed = 1
  368. if self.mAnimAct == mmo.ANIM_WALK then
  369. speed = self:GetWalkSpeed()
  370. elseif self.mAnimAct == mmo.ANIM_RUN then
  371. speed = self:GetRunSpeed()
  372. elseif self.mAnimAct == mmo.ANIM_ATTACK then
  373. speed = self:GetAttackAnimSpeed()
  374. elseif self.mAnimAct == mmo.ANIM_SKILL then
  375. speed = self:GetMagicAnimSpeed()
  376. end
  377. if self.mAnimation then
  378. self.mAnimation:Stop()
  379. self.mAnimation:Play( self.mAnimAct, animDir, isLoop, speed, self:IsSequence() )
  380. end
  381. if self.mAttachAnim then
  382. self.mAttachAnim:Stop()
  383. self.mAttachAnim:Play( self.mAnimAct, animDir, isLoop, speed, self:IsSequence() )
  384. end
  385. if self.mStopAnimFrameIndex then
  386. self:StopAllAnimation( self.mStopAnimFrameIndex )
  387. end
  388. --
  389. global.Facade:sendNotification(global.NoticeTable.ActorBuffPresentUpdate, self:GetID())
  390. end
  391. function gameActorMonster:getFixAnimDir()
  392. if fixAnimDirection[self.mClothID] then
  393. if type(fixAnimDirection[self.mClothID]) == "table" then
  394. return fixAnimDirection[self.mClothID][self.mAnimAct]
  395. else
  396. return fixAnimDirection[self.mClothID]
  397. end
  398. end
  399. return nil
  400. end
  401. function gameActorMonster:dirtyAnimFlag()
  402. self.mIsAnimNeedToUpdate = true
  403. end
  404. function gameActorMonster:GetType()
  405. return mmo.ACTOR_MONSTER
  406. end
  407. function gameActorMonster:GetAvatarNode()
  408. return self.mCurrAvatarNode
  409. end
  410. function gameActorMonster:GetAnimationID()
  411. return self.mClothID
  412. end
  413. function gameActorMonster:SetGameActorActionHandler(handler)
  414. self.mActionHandler = handler
  415. end
  416. function gameActorMonster:GetGameActorActionHandler()
  417. return self.mActionHandler
  418. end
  419. function gameActorMonster:GetLevel()
  420. return self.mLevel
  421. end
  422. function gameActorMonster:SetLevel(level)
  423. self.mLevel = level
  424. end
  425. function gameActorMonster:SetOwnerID(id)
  426. self.mOwnerID = id
  427. end
  428. function gameActorMonster:GetOwnerID()
  429. return self.mOwnerID
  430. end
  431. function gameActorMonster:SetOwnerName(name)
  432. self.mOwnerName = name
  433. end
  434. function gameActorMonster:GetOwnerName()
  435. return self.mOwnerName
  436. end
  437. function gameActorMonster:GetCurrActTime()
  438. return self.mCurrentActT
  439. end
  440. function gameActorMonster:SetCurrActTime(t)
  441. self.mCurrentActT = t
  442. end
  443. function gameActorMonster:SetStoneMode(mode)
  444. self.mStoneMode = mode
  445. end
  446. function gameActorMonster:GetStoneMode()
  447. return self.mStoneMode
  448. end
  449. function gameActorMonster:SetTypeIdex(index)
  450. self.mTypeIndex = index
  451. end
  452. function gameActorMonster:GetTypeIdex()
  453. return self.mTypeIndex
  454. end
  455. function gameActorMonster:SetRaceServer(mode)
  456. self.mRaceServer = mode
  457. end
  458. function gameActorMonster:GetRaceServer()
  459. return self.mRaceServer
  460. end
  461. function gameActorMonster:SetRaceImg(rm)
  462. self.mRaceImg = rm
  463. end
  464. function gameActorMonster:GetRaceImg()
  465. return self.mRaceImg
  466. end
  467. function gameActorMoveable:setCloaking(isCloaking, index)
  468. -- 隐身术
  469. self.mClocking = isCloaking
  470. self:CalcCover()
  471. end
  472. function gameActorMoveable:CalcCover()
  473. local opacityV = self.mClocking and 155 or 255
  474. if self.mAnimation then
  475. self.mAnimation:setOpacity( opacityV )
  476. end
  477. if self.mAttachAnim then
  478. self.mAttachAnim:setOpacity( opacityV )
  479. end
  480. end
  481. function gameActorMonster:GetHUDTop()
  482. if not self.mAnimation then
  483. return 20
  484. end
  485. return self.mAnimation:GetHUDTop() or 20
  486. end
  487. -- 大血条的头像id
  488. function gameActorMonster:SetBigTipIcon( value )
  489. self.mbigTipIcon = value
  490. end
  491. function gameActorMonster:GetBigTipIcon()
  492. return self.mbigTipIcon
  493. end
  494. function gameActorMonster:SetNoShowName(value)
  495. self.mNoShowName = value
  496. end
  497. function gameActorMonster:IsNoShowName()
  498. return self.mNoShowName == 1
  499. end
  500. function gameActorMonster:SetNoShowHPBar(value)
  501. self.mNoShowHPBar = value
  502. end
  503. function gameActorMonster:IsNoShowHPBar()
  504. return self.mNoShowHPBar == 1
  505. end
  506. -- 设置国家id
  507. function gameActorMonster:SetNationID( id )
  508. self._nationid = id
  509. end
  510. function gameActorMonster:GetNationID()
  511. return self._nationid
  512. end
  513. -- 国家模式是否可被攻击
  514. function gameActorMonster:SetNationEnemyPK( pk )
  515. self._nationEnemyPK = pk
  516. end
  517. function gameActorMonster:IsNationEnemyPK()
  518. return not (self._nationEnemyPK == 1)
  519. end
  520. -- 钻地怪,在洞穴中
  521. function gameActorMonster:SetSleepInCave( v )
  522. self.mIsSleepInCave = v
  523. end
  524. function gameActorMonster:IsSleepInCave()
  525. return self.mIsSleepInCave
  526. end
  527. -- 高亮
  528. function gameActorMonster:Bright()
  529. if self.mStoneMode then
  530. return
  531. end
  532. gameActorMonster.super.Bright(self)
  533. end
  534. return gameActorMonster