package PickSystem import initlater PlayerData import LinkedListModule import EscaperClasses import RevivePointModifier import ChannelAbilityPreset import Players EscaperDefinition array currentView constant START = gg_unit_revp_0002.getPos3Real() constant PICK = vec3(-6743,6616,100) public constant BLINK_ID = 'A001' public constant PICK_DUMMY_ID = compiletime(UNIT_ID_GEN.next()) constant PREV_ID = compiletime(ABIL_ID_GEN.next()) constant NEXT_ID = compiletime(ABIL_ID_GEN.next()) constant PICK_ID = compiletime(ABIL_ID_GEN.next()) interface EscaperClsr function create(PlayerData pd) class EscaperDefinition use LinkedListModule private FText nameTt private string mbicon unit escaper EscaperClsr cb construct(int escaperId) nameTt = createFText(PICK-vec2(64,64), "", 12) nameTt.tt.setVisibility(false) escaper = createUnit(DUMMY_PLAYER, escaperId, PICK, (315).fromDeg()) escaper..addAbility(LOCUST_ID)..setVertexColor(COLOR_BLACK) function setIcon(string path) mbicon = path function setName(string name) nameTt.tt..setText(name, 12) function showTo(PlayerData pd) if localPlayer == pd.p nameTt.tt..setVisibility(true) escaper.setVertexColor(COLOR_WHITE) function hide(PlayerData pd) if localPlayer == pd.p nameTt.tt..setVisibility(false) escaper.setVertexColor(COLOR_BLACK) function createFor(PlayerData pd) cb.create(pd) ResetToGameCameraForPlayer(pd.p,0.5) if isBuilderPlayer(pd.p) pd.escaper.actor..addAbility(BLINK_ID)..addAbility(CREATE_REV_MOD_ID) pd.escaper.selectatrevive = false pd.escaper.camOnRevive = false PanCameraToTimedForPlayer(pd.p,pd.builder.actor.getX(),pd.builder.actor.getY(),0) pd.p.selectSingle(pd.builder.actor) printTimedToPlayer(" You are a |cff528CDEBuilder|r!", 20, pd.p) else PanCameraToTimedForPlayer(pd.p,START.x,START.y,0) pd.p.selectSingle(pd.escaper.actor) printTimedToPlayer(" You are an |cff528CDEEscaper|r!", 20, pd.p) pd.icon = mbicon function setCallback(EscaperClsr closure) this.cb = closure public class Selector extends UnitEntity PlayerData pd construct(PlayerData pd) super(createUnit(pd.p, PICK_DUMMY_ID, PICK, 0. .fromRad())) this.pd = pd actor..addAbility(PREV_ID)..addAbility(NEXT_ID)..addAbility(PICK_ID)..setVertexColor(COLOR_BLACK) pd.p.selectSingle(actor) pd.selector = this EventListener.add(actor, EVENT_PLAYER_UNIT_SPELL_CAST, () -> onCast()) deactivate() function onCast() let id = GetSpellAbilityId() let pd = pData[actor.getOwner().getId()] switch id case PREV_ID currentView[pd.id].hide(pd) currentView[pd.id] = currentView[pd.id].getPrev() currentView[pd.id].showTo(pd) case NEXT_ID currentView[pd.id].hide(pd) currentView[pd.id] = currentView[pd.id].getNext() currentView[pd.id].showTo(pd) case PICK_ID currentView[pd.id].hide(pd) printTimedToPlayer("|cffE68C19Welcome to |cff086BC5Escape Builder Reloaded|cffE68C19!\n |r", 20, pd.p) currentView[pd.id].createFor(pd) destroy this ondestroy pd.selector = null override function slowUpdate() SetCameraFieldForPlayer(pd.p, CAMERA_FIELD_TARGET_DISTANCE, 1000.00, 0.50) SetCameraFieldForPlayer(pd.p, CAMERA_FIELD_ANGLE_OF_ATTACK, 343.00, 0.50) SetCameraTargetControllerNoZForPlayer(pd.p, EscaperDefinition.first.escaper, 0, 0, false) SetCameraFieldForPlayer(pd.p, CAMERA_FIELD_ROTATION, 315.+180., 0.50) SetCameraFieldForPlayer(pd.p, CAMERA_FIELD_ZOFFSET, 110, 0.5) SetCameraFieldForPlayer(pd.p, CAMERA_FIELD_FARZ, 15000.00, 0.5) gg_cam_Camera_001.apply(true, pd.p, 0.) boolean hastStartedYet = false public function startChoose() if not hastStartedYet hastStartedYet = true CinematicFadeBJ(bj_CINEFADETYPE_FADEIN, 2.00, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, 0, 0, 0) CameraSetupApplyForceDuration(gg_cam_Camera_001, true, 0.30) for pd from allPlayers.staticItr() regions[22].revealRegion(pd.p) new Selector(pd) EnablePreSelect(true, false) public function allow() EnableUserControl(true) EnableOcclusion(true) init new EscaperDefinition(ESC_HOLY_ID) ..setName("|cffFFC521Holy Escaper|r\nIn years of studies this priest mastered the art of healing and reincarnation.") ..setIcon("ReplaceableTextures\\CommandButtons\\BTNPriest.blp") ..setCallback() pd -> pd.escaper = new HolyEscaper(currentRevivepoint.withZ(100.), pd.p) new EscaperDefinition(ESC_STRONG_ID) ..setName("|cffAD4208Strong Escaper|r\nThis brave baronet perfected his defense abilites and will never retreat.") ..setIcon("ReplaceableTextures\\CommandButtons\\BTNFootman.blp") ..setCallback() pd -> pd.escaper = new StrongEscaper(currentRevivepoint.withZ(100.), pd.p) new EscaperDefinition(ESC_FAST_ID) ..setName("|cff08CEEFFast Escaper|r\nThis blazing fast hero inceases the movementspeed of himself and his mates and can create a portal.") ..setIcon("ReplaceableTextures\\CommandButtons\\BTNPeasant.blp") ..setCallback() pd -> pd.escaper = new FastEscaper(currentRevivepoint.withZ(100.), pd.p) new EscaperDefinition(ESC_ICE_ID) ..setName("|cff08D6FFIce Escaper|r\nBy living in the arctic snows for so long, this escaper knows how to handle sliding on ice.") ..setIcon("ReplaceableTextures\\CommandButtons\\BTNIceTrollBeserker.blp") ..setCallback() pd -> pd.escaper = new IceEscaper(currentRevivepoint.withZ(100.), pd.p) new EscaperDefinition(ESC_BLIND_ID) ..setName("|cff6B6BCEFemale Escaper|r\nA cold heart and years of bitching grant her some protection from lava.") ..setIcon(Icons.bTNHuntress) ..setCallback() pd -> pd.escaper = new BlindEscaper(currentRevivepoint.withZ(100.), pd.p) public function startPick() ALL_PLAYERS.forEach() p -> currentView[p.getId()] = EscaperDefinition.first for i = 0 to GetRandomInt(0, EscaperDefinition.size) currentView[p.getId()] = currentView[p.getId()].getNext() currentView[p.getId()].showTo(p.getData()) @objectgen function getSelector() new ChannelAbilityPreset(PREV_ID, 1, true)..presetIcon("BTNprevEffect.blp")..presetButtonPosNormal(0, 2) ..setName("Go to previous Escaper") ..presetHotkey("Y") ..presetTooltipNormal(lvl -> "Go to previous Escaper [|cffFFCC00Y|r]") ..presetTooltipNormalExtended(lvl -> "") new ChannelAbilityPreset(NEXT_ID, 1, true)..presetIcon("BTNnextEffect.blp")..presetButtonPosNormal(3, 2) ..setName("Go to next Escaper") ..presetHotkey("V") ..presetTooltipNormal(lvl -> "Go to next Escaper [|cffFFCC00V|r]") ..presetTooltipNormalExtended(lvl -> "") new ChannelAbilityPreset(PICK_ID, 1, true)..presetIcon("BTNstart.blp")..presetButtonPosNormal(0, 0) ..setName("Pick Escaper") ..presetTooltipNormal(lvl -> "Pick Escaper [|cffFFCC00Q|r]") ..presetHotkey("Q") ..presetTooltipNormalExtended(lvl -> "This will start your game as escaper.\nIf you have local files enabled your rank will be loaded and saved automatically.") new UnitDefinition(PICK_DUMMY_ID, 'hpea') ..setAttacksEnabled(0) ..setShadowImageUnit("") ..setModelFile("Objects\\RandomObject\\RandomObject.mdl") ..setSpeedBase(0) ..setCollisionSize(0) ..setNormalAbilities(commaList(GHOST_VIS_ID)) ..setHotkey("") ..setName("Select Escaper") ..setTooltipBasic("") ..setTooltipExtended("") ..setStructuresBuilt("") ..setUpgradesUsed("") ..setBuildTime(1) ..setHitPointsMaximumBase(100000000)