You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
111 lines
2.8 KiB
111 lines
2.8 KiB
12 years ago
|
-- @docclass Creature
|
||
|
|
||
|
-- @docconsts @{
|
||
|
|
||
13 years ago
|
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
|
||
|
|
||
12 years ago
|
-- @}
|
||
|
|
||
12 years ago
|
function getSkullImagePath(skullId)
|
||
12 years ago
|
local path
|
||
13 years ago
|
if skullId == SkullYellow then
|
||
12 years ago
|
path = 'icons/skull_yellow.png'
|
||
13 years ago
|
elseif skullId == SkullGreen then
|
||
12 years ago
|
path = 'icons/skull_green.png'
|
||
13 years ago
|
elseif skullId == SkullWhite then
|
||
12 years ago
|
path = 'icons/skull_white.png'
|
||
13 years ago
|
elseif skullId == SkullRed then
|
||
12 years ago
|
path = 'icons/skull_red.png'
|
||
13 years ago
|
elseif skullId == SkullBlack then
|
||
12 years ago
|
path = 'icons/skull_black.png'
|
||
13 years ago
|
elseif skullId == SkullOrange then
|
||
12 years ago
|
path = 'icons/skull_orange.png'
|
||
13 years ago
|
end
|
||
12 years ago
|
path = resolvepath(path)
|
||
|
return path
|
||
13 years ago
|
end
|
||
|
|
||
12 years ago
|
function getShieldImagePathAndBlink(shieldId)
|
||
12 years ago
|
local path
|
||
13 years ago
|
if shieldId == ShieldWhiteYellow then
|
||
12 years ago
|
path = 'icons/shield_yellow_white.png', false
|
||
13 years ago
|
elseif shieldId == ShieldWhiteBlue then
|
||
12 years ago
|
path = 'icons/shield_blue_white.png', false
|
||
13 years ago
|
elseif shieldId == ShieldBlue then
|
||
12 years ago
|
path = 'icons/shield_blue.png', false
|
||
13 years ago
|
elseif shieldId == ShieldYellow then
|
||
12 years ago
|
path = 'icons/shield_yellow.png', false
|
||
13 years ago
|
elseif shieldId == ShieldBlueSharedExp then
|
||
12 years ago
|
path = 'icons/shield_blue_shared.png', false
|
||
13 years ago
|
elseif shieldId == ShieldYellowSharedExp then
|
||
12 years ago
|
path = 'icons/shield_yellow_shared.png', false
|
||
13 years ago
|
elseif shieldId == ShieldBlueNoSharedExpBlink then
|
||
12 years ago
|
path = 'icons/shield_blue_not_shared.png', true
|
||
13 years ago
|
elseif shieldId == ShieldYellowNoSharedExpBlink then
|
||
12 years ago
|
path = 'icons/shield_yellow_not_shared.png', true
|
||
13 years ago
|
elseif shieldId == ShieldBlueNoSharedExp then
|
||
12 years ago
|
path = 'icons/shield_blue_not_shared.png', false
|
||
13 years ago
|
elseif shieldId == ShieldYellowNoSharedExp then
|
||
12 years ago
|
path = 'icons/shield_yellow_not_shared.png', false
|
||
13 years ago
|
end
|
||
12 years ago
|
path = resolvepath(path)
|
||
|
return path
|
||
13 years ago
|
end
|
||
|
|
||
12 years ago
|
function getEmblemImagePath(emblemId)
|
||
12 years ago
|
local path
|
||
13 years ago
|
if emblemId == EmblemGreen then
|
||
12 years ago
|
path = 'icons/emblem_green.png'
|
||
13 years ago
|
elseif emblemId == EmblemRed then
|
||
12 years ago
|
path = 'icons/emblem_red.png'
|
||
13 years ago
|
elseif emblemId == EmblemBlue then
|
||
12 years ago
|
path = 'icons/emblem_blue.png'
|
||
12 years ago
|
end
|
||
12 years ago
|
path = resolvepath(path)
|
||
|
return path
|
||
12 years ago
|
end
|
||
|
|
||
|
function Creature:onSkullChange(skullId)
|
||
|
local imagePath = getSkullImagePath(skullId)
|
||
|
if imagePath then
|
||
12 years ago
|
self:setSkullTexture(imagePath)
|
||
12 years ago
|
end
|
||
|
end
|
||
|
|
||
|
function Creature:onShieldChange(shieldId)
|
||
|
local imagePath, blink = getShieldImagePathAndBlink(shieldId)
|
||
|
if imagePath then
|
||
12 years ago
|
self:setShieldTexture(imagePath, blink)
|
||
12 years ago
|
end
|
||
|
end
|
||
|
|
||
|
function Creature:onEmblemChange(emblemId)
|
||
|
local imagePath = getEmblemImagePath(emblemId)
|
||
|
if imagePath then
|
||
12 years ago
|
self:setEmblemTexture(imagePath)
|
||
13 years ago
|
end
|
||
|
end
|