local MakePlayerCharacter = require "prefabs/player_common"
local assets = {
Asset( "ANIM", "anim/player_basic.zip" ), Asset( "ANIM", "anim/player_idles_shiver.zip" ), Asset( "ANIM", "anim/player_actions.zip" ), Asset( "ANIM", "anim/player_actions_axe.zip" ), Asset( "ANIM", "anim/player_actions_pickaxe.zip" ), Asset( "ANIM", "anim/player_actions_shovel.zip" ), Asset( "ANIM", "anim/player_actions_blowdart.zip" ), Asset( "ANIM", "anim/player_actions_eat.zip" ), Asset( "ANIM", "anim/player_actions_item.zip" ), Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ), Asset( "ANIM", "anim/player_actions_bugnet.zip" ), Asset( "ANIM", "anim/player_actions_fishing.zip" ), Asset( "ANIM", "anim/player_actions_boomerang.zip" ), Asset( "ANIM", "anim/player_bush_hat.zip" ), Asset( "ANIM", "anim/player_attacks.zip" ), Asset( "ANIM", "anim/player_idles.zip" ), Asset( "ANIM", "anim/player_rebirth.zip" ), Asset( "ANIM", "anim/player_jump.zip" ), Asset( "ANIM", "anim/player_amulet_resurrect.zip" ), Asset( "ANIM", "anim/player_teleport.zip" ), Asset( "ANIM", "anim/wilson_fx.zip" ), Asset( "ANIM", "anim/player_one_man_band.zip" ), Asset( "ANIM", "anim/shadow_hands.zip" ), Asset( "SOUND", "sound/sfx.fsb" ), Asset( "SOUND", "sound/wilson.fsb" ), Asset( "ANIM", "anim/beard.zip" ),
-- Don't forget to include your character's custom assets! Asset( "ANIM", "anim/charlie.zip" ),}local prefabs = {}
local function updatedamage(inst) if GetClock():IsDay() then inst.components.combat.damagemultiplier = 1 elseif GetClock():IsNight() then inst.components.combat.damagemultiplier = 2 elseif GetClock():IsDusk() then inst.components.combat.damagemultiplier = 1.5 end
end
local fn = function(inst) -- choose which sounds this character will play inst.soundsname = "charlie"
-- a minimap icon must be specified inst.MiniMapEntity:SetIcon( "charlie.tex" )
-- todo: Add an example special power here. updatedamage(inst)
inst:ListenForEvent( "dusktime", function() updatedamage(inst) end , GetWorld()) inst:ListenForEvent( "daytime", function() updatedamage(inst) end , GetWorld()) inst:ListenForEvent( "nighttime", function() updatedamage(inst) end , GetWorld()) inst.components.health.maxhealth = 113inst.components.sanity.night_drain_mult = 1.25end
return MakePlayerCharacter("charlie", prefabs, assets, fn)
local assets = {
Asset( "ANIM", "anim/player_basic.zip" ), Asset( "ANIM", "anim/player_idles_shiver.zip" ), Asset( "ANIM", "anim/player_actions.zip" ), Asset( "ANIM", "anim/player_actions_axe.zip" ), Asset( "ANIM", "anim/player_actions_pickaxe.zip" ), Asset( "ANIM", "anim/player_actions_shovel.zip" ), Asset( "ANIM", "anim/player_actions_blowdart.zip" ), Asset( "ANIM", "anim/player_actions_eat.zip" ), Asset( "ANIM", "anim/player_actions_item.zip" ), Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ), Asset( "ANIM", "anim/player_actions_bugnet.zip" ), Asset( "ANIM", "anim/player_actions_fishing.zip" ), Asset( "ANIM", "anim/player_actions_boomerang.zip" ), Asset( "ANIM", "anim/player_bush_hat.zip" ), Asset( "ANIM", "anim/player_attacks.zip" ), Asset( "ANIM", "anim/player_idles.zip" ), Asset( "ANIM", "anim/player_rebirth.zip" ), Asset( "ANIM", "anim/player_jump.zip" ), Asset( "ANIM", "anim/player_amulet_resurrect.zip" ), Asset( "ANIM", "anim/player_teleport.zip" ), Asset( "ANIM", "anim/wilson_fx.zip" ), Asset( "ANIM", "anim/player_one_man_band.zip" ), Asset( "ANIM", "anim/shadow_hands.zip" ), Asset( "SOUND", "sound/sfx.fsb" ), Asset( "SOUND", "sound/wilson.fsb" ), Asset( "ANIM", "anim/beard.zip" ),
-- Don't forget to include your character's custom assets! Asset( "ANIM", "anim/charlie.zip" ),}local prefabs = {}
local function updatedamage(inst) if GetClock():IsDay() then inst.components.combat.damagemultiplier = 1 elseif GetClock():IsNight() then inst.components.combat.damagemultiplier = 2 elseif GetClock():IsDusk() then inst.components.combat.damagemultiplier = 1.5 end
end
local fn = function(inst) -- choose which sounds this character will play inst.soundsname = "charlie"
-- a minimap icon must be specified inst.MiniMapEntity:SetIcon( "charlie.tex" )
-- todo: Add an example special power here. updatedamage(inst)
inst:ListenForEvent( "dusktime", function() updatedamage(inst) end , GetWorld()) inst:ListenForEvent( "daytime", function() updatedamage(inst) end , GetWorld()) inst:ListenForEvent( "nighttime", function() updatedamage(inst) end , GetWorld()) inst.components.health.maxhealth = 113inst.components.sanity.night_drain_mult = 1.25end
return MakePlayerCharacter("charlie", prefabs, assets, fn)