1-- Copyright (C) 2007, 2010 - Bit-Blot 2-- 3-- This file is part of Aquaria. 4-- 5-- Aquaria is free software; you can redistribute it and/or 6-- modify it under the terms of the GNU General Public License 7-- as published by the Free Software Foundation; either version 2 8-- of the License, or (at your option) any later version. 9-- 10-- This program is distributed in the hope that it will be useful, 11-- but WITHOUT ANY WARRANTY; without even the implied warranty of 12-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13-- 14-- See the GNU General Public License for more details. 15-- 16-- You should have received a copy of the GNU General Public License 17-- along with this program; if not, write to the Free Software 18-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 20if not v then v = {} end 21if not AQUARIA_VERSION then dofile("scripts/entities/entityinclude.lua") end 22 23v.n = 0 24 25function init(me) 26 setupEntity(me) 27 entity_setEntityType(me, ET_ENEMY) 28 entity_initSkeletal(me, "SpikyBall") 29 30 entity_setAllDamageTargets(me, false) 31 32 entity_scale(me, 0, 0) 33 entity_scale(me, 2, 2, 1) 34 35 entity_color(me, 1, 0.6, 0.6) 36 37 entity_setCollideRadius(me, 64) 38 39 entity_setTargetRange(me, -9000) 40 41 entity_setState(me, STATE_IDLE) 42end 43 44function postInit(me) 45 v.n = getNaija() 46 entity_setTarget(me, v.n) 47end 48 49function update(me, dt) 50 entity_updateMovement(me, dt) 51 52 entity_setDamageTarget(me, DT_ENEMY_ENERGYBLAST, false) 53 entity_setDamageTarget(me, DT_AVATAR_ENERGYBLAST, true) 54 entity_setDamageTarget(me, DT_AVATAR_SHOCK, true) 55 entity_setDamageTarget(me, DT_AVATAR_LIZAP, true) 56 57 entity_handleShotCollisions(me) 58 59 entity_setDamageTarget(me, DT_AVATAR_ENERGYBLAST, false) 60 entity_setDamageTarget(me, DT_AVATAR_SHOCK, false) 61 entity_setDamageTarget(me, DT_AVATAR_LIZAP, false) 62 63 entity_touchAvatarDamage(me, entity_getCollideRadius(me), 0.5, 500, 0.2) 64end 65 66function enterState(me) 67 if entity_isState(me, STATE_IDLE) then 68 entity_animate(me, "idle", -1) 69 end 70end 71 72function exitState(me) 73end 74 75function damage(me, attacker, bone, damageType, dmg) 76 playNoEffect() 77 return false 78end 79 80function animationKey(me, key) 81end 82 83function hitSurface(me) 84end 85 86function songNote(me, note) 87end 88 89function songNoteDone(me, note) 90end 91 92function song(me, song) 93end 94 95function activate(me) 96end 97 98