package Selector import Entity import Builder import PlayerData import Rocket import Assets import SoundUtils import ClosureTimers import Wave import Interpolation public constant FAT_ID = 'h022' public constant SLIM_ID = 'h00F' public constant ELVEN_ID = 'h029' public constant FAT_SPELL_ID = 'A01Y' public constant SLIM_SPELL_ID = 'A01X' public constant ELVEN_SPELL_ID = 'A01L' constant PUDDING_ID = 'I00B' constant ENERGY_ID = 'I00C' constant ROCK_ID = 'I00D' let snd = new SoundDefinition("Units\\Creeps\\Ogre\\OgrePissed5.wav", false) public class Selector extends UnitEntity FText ownerTag vec3 finalPos vec3 mid real p = 0. construct(vec3 ppos, player owner) super(createUnit(owner, 'h023', middle.toVec3(), angle(0))) ownerTag = createFText(ppos - vec3(20,25,0), owner.getNameColored(), 12.5) actor..setVertexColor(owner.getColor().toColor().withAlpha(255)) ..setPropWindow(angle(0.)) finalPos = ppos mid = middle.polarOffset(middle.angleTo(finalPos.toVec2()) + (48).fromDeg(), 168).toVec3() owner..select(actor) ..panCameraToTimed(actor.getPos(), 0.) EventListener.onCast(actor) id -> let pd = pDatas[owner.getId()] switch id case FAT_SPELL_ID pd.builder = new Builder(actor.getPos3Zero(), pd, FAT_ID) pd.builder.actor.addItemById(PUDDING_ID) if owner.getName().toLowerCase() == "cokemonkey11" or owner.getName().toLowerCase() == "waterknight" let eff = addEffect(Abilities.plagueCloudCaster, pd.builder.getPos()) doAfter(5, () -> eff.destr()) // snd.playForPlayer(owner) case SLIM_SPELL_ID pd.builder = new Builder(actor.getPos3Zero(), pd, SLIM_ID) pd.builder.actor.addItemById(ENERGY_ID) case ELVEN_SPELL_ID pd.builder = new Builder(actor.getPos3Zero(), pd, ELVEN_ID) pd.builder.actor.addItemById(ROCK_ID) pd.builder.actor.addItemById(ROCKET_ITEM_ID) terminate() override function slowUpdate() super.slowUpdate() owner.panCameraToTimed(getPos(), 0.) owner.selectSingle(actor) override function update() if p > 0.990 deactivate() return p = p.lerp(1, 0.025) pos = pos.bezier3(mid, finalPos, p) actor.setXY(pos.toVec2()) ownerTag.tt.setPos(pos - vec3(20,25,0)) owner.selectSingle(actor) ondestroy actor.remove() destroy ownerTag pDatas[owner.getId()].select = null