2012-06-26 00:13:30 +02:00
|
|
|
-- @docclass Creature
|
|
|
|
|
|
|
|
-- @docconsts @{
|
|
|
|
|
2012-01-07 00:54:17 +01:00
|
|
|
SkullNone = 0
|
|
|
|
SkullYellow = 1
|
|
|
|
SkullGreen = 2
|
|
|
|
SkullWhite = 3
|
|
|
|
SkullRed = 4
|
|
|
|
SkullBlack = 5
|
|
|
|
SkullOrange = 6
|
|
|
|
|
|
|
|
ShieldNone = 0
|
|
|
|
ShieldWhiteYellow = 1
|
|
|
|
ShieldWhiteBlue = 2
|
|
|
|
ShieldBlue = 3
|
|
|
|
ShieldYellow = 4
|
|
|
|
ShieldBlueSharedExp = 5
|
|
|
|
ShieldYellowSharedExp = 6
|
|
|
|
ShieldBlueNoSharedExpBlink = 7
|
|
|
|
ShieldYellowNoSharedExpBlink = 8
|
|
|
|
ShieldBlueNoSharedExp = 9
|
|
|
|
ShieldYellowNoSharedExp = 10
|
|
|
|
|
|
|
|
EmblemNone = 0
|
|
|
|
EmblemGreen = 1
|
|
|
|
EmblemRed = 2
|
|
|
|
EmblemBlue = 3
|
|
|
|
|
2012-06-26 00:13:30 +02:00
|
|
|
-- @}
|
|
|
|
|
2012-02-09 06:27:29 +01:00
|
|
|
function getSkullImagePath(skullId)
|
2012-07-18 01:49:21 +02:00
|
|
|
local path
|
2012-01-07 00:54:17 +01:00
|
|
|
if skullId == SkullYellow then
|
2013-01-18 23:39:11 +01:00
|
|
|
path = '/images/game/skulls/skull_yellow'
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif skullId == SkullGreen then
|
2013-01-18 23:39:11 +01:00
|
|
|
path = '/images/game/skulls/skull_green'
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif skullId == SkullWhite then
|
2013-01-18 23:39:11 +01:00
|
|
|
path = '/images/game/skulls/skull_white'
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif skullId == SkullRed then
|
2013-01-18 23:39:11 +01:00
|
|
|
path = '/images/game/skulls/skull_red'
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif skullId == SkullBlack then
|
2013-01-18 23:39:11 +01:00
|
|
|
path = '/images/game/skulls/skull_black'
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif skullId == SkullOrange then
|
2013-01-18 23:39:11 +01:00
|
|
|
path = '/images/game/skulls/skull_orange'
|
2012-01-07 00:54:17 +01:00
|
|
|
end
|
2012-07-18 01:49:21 +02:00
|
|
|
return path
|
2012-01-07 00:54:17 +01:00
|
|
|
end
|
|
|
|
|
2012-02-09 06:27:29 +01:00
|
|
|
function getShieldImagePathAndBlink(shieldId)
|
2013-01-17 19:57:03 +01:00
|
|
|
local path, blink
|
2012-01-07 00:54:17 +01:00
|
|
|
if shieldId == ShieldWhiteYellow then
|
2013-01-18 23:39:11 +01:00
|
|
|
path, blink = '/images/game/shields/shield_yellow_white', false
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif shieldId == ShieldWhiteBlue then
|
2013-01-18 23:39:11 +01:00
|
|
|
path, blink = '/images/game/shields//shield_blue_white', false
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif shieldId == ShieldBlue then
|
2013-01-18 23:39:11 +01:00
|
|
|
path, blink = '/images/game/shields//shield_blue', false
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif shieldId == ShieldYellow then
|
2013-01-18 23:39:11 +01:00
|
|
|
path, blink = '/images/game/shields//shield_yellow', false
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif shieldId == ShieldBlueSharedExp then
|
2013-01-18 23:39:11 +01:00
|
|
|
path, blink = '/images/game/shields//shield_blue_shared', false
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif shieldId == ShieldYellowSharedExp then
|
2013-01-18 23:39:11 +01:00
|
|
|
path, blink = '/images/game/shields//shield_yellow_shared', false
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif shieldId == ShieldBlueNoSharedExpBlink then
|
2013-01-18 23:39:11 +01:00
|
|
|
path, blink = '/images/game/shields//shield_blue_not_shared', true
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif shieldId == ShieldYellowNoSharedExpBlink then
|
2013-01-18 23:39:11 +01:00
|
|
|
path, blink = '/images/game/shields//shield_yellow_not_shared', true
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif shieldId == ShieldBlueNoSharedExp then
|
2013-01-18 23:39:11 +01:00
|
|
|
path, blink = '/images/game/shields//shield_blue_not_shared', false
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif shieldId == ShieldYellowNoSharedExp then
|
2013-01-18 23:39:11 +01:00
|
|
|
path, blink = '/images/game/shields//shield_yellow_not_shared', false
|
2012-01-07 00:54:17 +01:00
|
|
|
end
|
2013-01-17 19:57:03 +01:00
|
|
|
return path, blink
|
2012-01-07 00:54:17 +01:00
|
|
|
end
|
|
|
|
|
2012-02-09 06:27:29 +01:00
|
|
|
function getEmblemImagePath(emblemId)
|
2012-07-18 01:49:21 +02:00
|
|
|
local path
|
2012-01-07 00:54:17 +01:00
|
|
|
if emblemId == EmblemGreen then
|
2013-01-18 23:39:11 +01:00
|
|
|
path = '/images/game/emblems/emblem_green'
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif emblemId == EmblemRed then
|
2013-01-18 23:39:11 +01:00
|
|
|
path = '/images/game/emblems/emblem_red'
|
2012-01-07 00:54:17 +01:00
|
|
|
elseif emblemId == EmblemBlue then
|
2013-01-18 23:39:11 +01:00
|
|
|
path = '/images/game/emblems/emblem_blue'
|
2012-02-09 06:27:29 +01:00
|
|
|
end
|
2012-07-18 01:49:21 +02:00
|
|
|
return path
|
2012-02-09 06:27:29 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
function Creature:onSkullChange(skullId)
|
|
|
|
local imagePath = getSkullImagePath(skullId)
|
|
|
|
if imagePath then
|
2012-07-18 01:49:21 +02:00
|
|
|
self:setSkullTexture(imagePath)
|
2012-02-09 06:27:29 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function Creature:onShieldChange(shieldId)
|
|
|
|
local imagePath, blink = getShieldImagePathAndBlink(shieldId)
|
|
|
|
if imagePath then
|
2012-07-18 01:49:21 +02:00
|
|
|
self:setShieldTexture(imagePath, blink)
|
2012-02-09 06:27:29 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function Creature:onEmblemChange(emblemId)
|
|
|
|
local imagePath = getEmblemImagePath(emblemId)
|
|
|
|
if imagePath then
|
2012-07-18 01:49:21 +02:00
|
|
|
self:setEmblemTexture(imagePath)
|
2012-01-07 00:54:17 +01:00
|
|
|
end
|
|
|
|
end
|