// 발 연기 생성. protected void createFootSmoke(Vector3 worldPosition, Vector3 velocity) { GameObject go; go = EffectRoot.get().createBossFootSmokeEffect(worldPosition); go.GetComponent <FootSmokeEffectControl>().velocity = velocity; }
// ================================================================ // // 머리 아픈 상태(아이스 과식)를 시작한다. public void startJinJin() { this.jin_jin_timer.current = 0.0f; this.jin_jin_timer.duration = 5.0f; if (this.jin_jin_effect == null) { this.jin_jin_effect = EffectRoot.get().createJinJinEffect(this.control.getPosition() + new Vector3(0.0f, 2.5f, -0.5f)); } this.skin_color_control.startJinJin(); }
// 양초에 불을 붙인다(효과). public void igniteCandles() { do { // 이미 불이 붙어 있을 때는(효과를 묶는 GameObject가 있다). // 아무것도 하지 않는다. if (this.transform.FindChild("fires") != null) { break; } // 기둥을 묶는 GameObject를 찾는다. Transform childPillars = this.transform.FindChild("pillars"); if (childPillars == null) { break; } GameObject pillars_root = this.transform.FindChild("pillars").gameObject; // 이펙트를 만든다. GameObject fire_root = new GameObject("fires"); fire_root.transform.parent = this.gameObject.transform; float height = 3.0f; // 모든 자식(모든 기둥)에 효과를 적용한다. for (int i = 0; i < pillars_root.transform.childCount; i++) { GameObject pillar = pillars_root.transform.GetChild(i).gameObject; GameObject effect = EffectRoot.get().createCandleFireEffect(pillar.transform.position + Vector3.up * height); effect.transform.parent = fire_root.transform; } } while(false); }
void Start() { GameObject go; Vector3 center = this.transform.position + Vector3.up * 1.0f; float y_angle; float radius; y_angle = this.get_random(5.0f, 10.0f); // 아얏 radius = 1.5f; go = EffectRoot.get().createHitIteEffect(center); go.transform.parent = this.transform; go.transform.localRotation = Quaternion.identity; go.transform.localRotation *= Quaternion.AngleAxis(-y_angle, Vector3.up); go.transform.Translate(Vector3.forward * radius); // ☆. foreach (var i in System.Linq.Enumerable.Range(0, 3)) { go = EffectRoot.get().createHitHosiEffect(center); go.transform.parent = this.transform; y_angle = 45.0f + (float)i * 135.0f; y_angle += this.get_random(5.0f, 15.0f); radius = 1.0f; go.transform.localRotation = Quaternion.identity; go.transform.localRotation *= Quaternion.AngleAxis(-y_angle, Vector3.up); go.transform.Translate(Vector3.forward * radius); } }
public override void execute() { CameraControl camera = CameraControl.get(); // ---------------------------------------------------------------- // // 다음 상태로 이동할지 체크합니다. switch (this.step.do_transition()) { // 이벤트 시작. case STEP.START: { this.step.set_next(STEP.OPEN_DOOR); //camera.module.parallelMoveTo(this.get_locator_position("cam_loc_0")); Debug.Log("Name:" + this.player.controll.account_name); foreach (ItemManager.ItemState istate in GlobalParam.get().item_table.Values) { Debug.Log("Item:" + istate.item_id + " Own:" + istate.owner + " State:" + istate.state); if (istate.owner == this.player.controll.account_name && istate.state == ItemController.State.Picked) { // 이미 아이템을 획득했다면 가지고 갈 수 있게 합니다. ItemManager.get().activeItme(istate.item_id, true); ItemManager.get().finishGrowingItem(istate.item_id); QueryItemPick query = this.player.controll.cmdItemQueryPick(istate.item_id, false, true); if (query != null) { query.is_anon = true; query.set_done(true); query.set_success(true); } ItemManager.get().setVisible(istate.item_id, true); } } // 리모트에서 이사 중은 로컬도 이사합니다. do { MovingData moving = GlobalParam.get().remote_moving; if (!moving.moving) { break; } chrController remote = CharacterRoot.get().findCharacter(moving.characterId); if (remote == null) { break; } chrBehaviorNet remote_player = remote.behavior as chrBehaviorNet; if (remote_player == null) { break; } chrBehaviorNPC_House house = CharacterRoot.getInstance().findCharacter <chrBehaviorNPC_House>(moving.houseId); if (house == null) { break; } Debug.Log("House move event call:" + moving.characterId + ":" + moving.houseId); remote_player.beginHouseMove(house); // '이사중~' 말풍선 표시. house.startHouseMove(); } while(false); } break; // 배추가 옆으로 움직이고 & 대야를 타고 플레이어가 등장. case STEP.OPEN_DOOR: { if (this.hakusai_fcurve.isDone() && this.tarai_fcurve.isDone()) { this.step.set_next(STEP.GET_OFF_TARAI_0); } } break; // 대야에서 내립니다(기슭으로 점프). case STEP.GET_OFF_TARAI_0: { if (!this.player_jump.isMoving()) { this.step.set_next(STEP.GET_OFF_TARAI_1); } } break; // 대야에서 내립니다(조금 걷기). case STEP.GET_OFF_TARAI_1: { if (!this.player_move.isMoving()) { this.step.set_next(STEP.CLOSE_DOOR); } } break; // 배추가 돌아오고 & 대야가 밖으로 이동. case STEP.CLOSE_DOOR: { if (this.hakusai_fcurve.isDone() && this.tarai_fcurve.isDone()) { this.step.set_next(STEP.END); } } break; case STEP.END: { camera.module.popPosture(); this.step.set_next(STEP.IDLE); } break; } // ---------------------------------------------------------------- // // 상태가 전환됐을 때의 초기화. while (this.step.get_next() != STEP.NONE) { dbwin.console().print(this.step.ToString()); switch (this.step.do_initialize()) { // 이벤트 시작. case STEP.START: { camera.module.pushPosture(); this.player.beginOuterControll(); this.player.controll.cmdSetPosition(this.tarai_leave_spline.curve.cvs.back().position); this.tarai_fune.transform.position = this.tarai_leave_spline.curve.cvs.back().position; if (!this.is_local_player) { SoundManager.get().playSE(Sound.ID.SMN_JINGLE01); } } break; // 배추가 옆으로 이동하고 & 대야를 타고 플레이어가 등장. case STEP.OPEN_DOOR: { this.hakusai_set.setControl(true); this.hakusai_fcurve.setSlopeAngle(10.0f, 10.0f); this.hakusai_fcurve.setDuration(4.0f); this.hakusai_fcurve.start(); this.hakusai_tracer.restart(); this.tarai_fcurve.setSlopeAngle(60.0f, 5.0f); this.tarai_fcurve.setDuration(3.5f); this.tarai_fcurve.setDelay(0.5f); this.tarai_fcurve.start(); } break; // 대야에서 내립니다(기슭으로 점프). case STEP.GET_OFF_TARAI_0: { Vector3 start = this.player.controll.getPosition(); Vector3 goal = this.get_locator_position("chr_loc_0"); this.player_jump.start(start, goal, 1.0f); } break; // 대야에서 내립니다(조금 걷기). case STEP.GET_OFF_TARAI_1: { this.player_move.position.start = this.player.controll.getPosition(); this.player_move.position.goal = this.get_locator_position("chr_loc_1"); this.player_move.startConstantVelocity(chrBehaviorLocal.MOVE_SPEED); } break; // 배추가 돌아오고 & 대야가 밖으로 이동. case STEP.CLOSE_DOOR: { this.hakusai_fcurve.setSlopeAngle(10.0f, 10.0f); this.hakusai_fcurve.setDuration(4.0f); this.hakusai_fcurve.setDelay(1.0f); this.hakusai_fcurve.start(); this.hakusai_tracer.restart(); this.hakusai_tracer.setCurrentByDistance(this.hakusai_tracer.curve.calcTotalDistance()); this.tarai_tracer.attach(this.tarai_enter_spline.curve); this.tarai_tracer.restart(); this.tarai_fcurve.reset(); this.tarai_fcurve.setSlopeAngle(10.0f, 60.0f); this.tarai_fcurve.setDuration(2.5f); this.tarai_fcurve.start(); this.ripple_effect.is_created = false; } break; case STEP.END: { // 이벤트 종료. this.hakusai_set.reset(); this.hakusai_set.setControl(false); this.player.endOuterControll(); this.player = null; } break; } } // ---------------------------------------------------------------- // // 각 상태에서의 실행 처리. switch (this.step.do_execution(Time.deltaTime)) { // 배추가 옆으로 움직인다 & 대야를 타고 플레이어가 등장.. case STEP.OPEN_DOOR: { this.hakusai_fcurve.execute(Time.deltaTime); this.hakusai_tracer.proceedToDistance(this.hakusai_tracer.curve.calcTotalDistance() * this.hakusai_fcurve.getValue()); this.hakusai_set.setPosition(this.hakusai_tracer.cv.position); this.tarai_fcurve.execute(Time.deltaTime); this.tarai_tracer.proceedToDistance(this.tarai_tracer.curve.calcTotalDistance() * (1.0f - this.tarai_fcurve.getValue())); SimpleSpline.ControlVertex cv = this.tarai_tracer.getCurrent(); this.tarai_fune.setPosition(cv.position); this.player.controll.cmdSetPosition(cv.position); this.player.controll.cmdSmoothHeadingTo(cv.position - cv.tangent.Y(0.0f)); if (this.tarai_fcurve.isTriggerDone()) { this.ripple_effect.is_created = false; } } break; // 대야에서 내립니다(기슭을 향해 점프). case STEP.GET_OFF_TARAI_0: { this.player_jump.execute(Time.deltaTime); this.player.controll.cmdSetPosition(this.player_jump.position); this.player.controll.cmdSmoothHeadingTo(this.player_jump.goal); } break; // 대야에서 내립니다(조금 걷는다). case STEP.GET_OFF_TARAI_1: { this.player_move.execute(Time.deltaTime); this.player.controll.cmdSetPosition(this.player_move.position.current); this.player.controll.cmdSmoothHeadingTo(this.player_move.position.goal); this.player.playWalkMotion(); } break; // 배추가 돌아옵니다 & 대야가 밖으로 이동. case STEP.CLOSE_DOOR: { this.hakusai_fcurve.execute(Time.deltaTime); this.hakusai_tracer.proceedToDistance(this.hakusai_tracer.curve.calcTotalDistance() * (1.0f - this.hakusai_fcurve.getValue())); this.hakusai_set.setPosition(this.hakusai_tracer.getCurrent().position); this.tarai_fcurve.execute(Time.deltaTime); this.tarai_tracer.proceedToDistance(this.tarai_tracer.curve.calcTotalDistance() * (1.0f - this.tarai_fcurve.getValue())); this.tarai_fune.transform.position = this.tarai_tracer.getCurrent().position; this.player.stopWalkMotion(); } break; } // 대야 뒤에 나오는 물결. if (!this.ripple_effect.is_created || Vector3.Distance(this.ripple_effect.last_position, this.tarai_fune.getPosition()) > 2.0f) { this.ripple_effect.is_created = true; this.ripple_effect.last_position = this.tarai_fune.transform.position; EffectRoot.get().createRipple(this.ripple_effect.last_position); } // ---------------------------------------------------------------- // }
// 매 프레임 호출. public virtual void execute() { // ---------------------------------------------------------------- // // 다음 상태로 전환할지 체크. switch (this.step.do_transition()) { case STEP.IDLE: { } break; } // ---------------------------------------------------------------- // // 상태 전환 시 초기화. while (this.step.get_next() != STEP.NONE) { switch (this.step.do_initialize()) { case STEP.SPAWN: { this.ip_jump.setBounciness(new Vector3(0.0f, -0.5f, 0.0f)); Vector3 start = this.transform.position; Vector3 goal = this.transform.position; this.ip_jump.start(start, goal, 1.0f); EffectRoot.get().createSmokeMiddle(this.transform.position); } break; case STEP.FALL: { this.ip_jump.setBounciness(new Vector3(0.0f, -0.5f, 0.0f)); Vector3 start = this.transform.position + Vector3.up * 10.0f; Vector3 goal = this.transform.position; this.ip_jump.start(start, goal, 1.0f); } break; case STEP.BUFFET: { this.ip_jump.setBounciness(new Vector3(0.0f, -0.5f, 0.0f)); Vector3 start = this.transform.position; Vector3 goal = this.buffet_goal; this.ip_jump.start(start, goal, this.buffet_height); //EffectRoot.get().createSmokeMiddle(this.transform.position); } break; } } // ---------------------------------------------------------------- // // 각 상태에서의 실행 처리. switch (this.step.do_execution(Time.deltaTime)) { case STEP.FALL: case STEP.SPAWN: { this.ip_jump.execute(Time.deltaTime); this.transform.position = this.ip_jump.position; } break; case STEP.BUFFET: { this.ip_jump.execute(Time.deltaTime); if (!this.controll.isPickable()) { if (this.ip_jump.velocity.y <= 0.0f) { this.controll.cmdSetPickable(true); } } this.transform.position = this.ip_jump.position; } break; } // ---------------------------------------------------------------- // }
// ================================================================ // public override void onDamaged() { this.control.cmdSetMotion("m005_damage", 1); EffectRoot.get().createHitEffect(this.transform.position); }
private void resolve_pick_item_query(QueryItemPick query) { do { if (!query.isSuccess()) { break; } // 아이템 효과만 복사하고 삭제한다. ItemController item = this.control.cmdItemPick(query, query.target); if (item == null) { break; } // 이펙트. EffectRoot.get().createItemGetEffect(this.control.getPosition()); SoundManager.get().playSE(Sound.ID.DDG_SE_SYS02); Debug.Log("Item favor category:" + item.behavior.item_favor.category); switch (item.behavior.item_favor.category) { case Item.CATEGORY.FOOD: { this.control.vital.healFull(); this.skin_color_control.startHealing(); this.cake_count++; } break; case Item.CATEGORY.KEY: { PartyControl.get().getLocalPlayer().control.consumeKey(item); } break; case Item.CATEGORY.FLOOR_KEY: { PartyControl.get().getLocalPlayer().control.consumeKey(item); } break; case Item.CATEGORY.CANDY: { this.startShotBoost(); } break; case Item.CATEGORY.WEAPON: { SHOT_TYPE shot_type = Item.Weapon.getShotType(item.name); if (shot_type != SHOT_TYPE.NONE) { this.changeBulletShooter(shot_type); } } break; } item.vanish(); } while(false); query.set_expired(true); }
// ================================================================ // // ?쒖옉. public void initialize() { EffectRoot.get().createHealEffect(this.player.control.getPosition()); }
private void resolve_pick_item_query(QueryItemPick query) { do { if (!query.isSuccess()) { break; } // 아이템 효능만 복사하고 삭제한다. ItemController item = this.control.cmdItemPick(query, query.target); if (item == null) { break; } // 효과. EffectRoot.get().createItemGetEffect(this.control.getPosition()); SoundManager.get().playSE(Sound.ID.DDG_SE_SYS02); switch (item.behavior.item_favor.category) { case Item.CATEGORY.CANDY: { // 아이템 창에 아이콘 표시. this.item_slot.candy.favor = item.behavior.item_favor.clone(); ItemWindow.get().setItem(Item.SLOT_TYPE.CANDY, 0, this.item_slot.candy.favor); // 샷의 일정시간 파워업 this.startShotBoost(); } break; case Item.CATEGORY.SODA_ICE: case Item.CATEGORY.ETC: { // 빈 슬롯에 아이템 설정. int slot_index = this.item_slot.getEmptyMiscSlot(); if (slot_index >= 0) { this.item_slot.miscs[slot_index].item_id = query.target; this.item_slot.miscs[slot_index].favor = item.behavior.item_favor.clone(); // 아이템 창에 아이콘 표시. ItemWindow.get().setItem(Item.SLOT_TYPE.MISC, slot_index, this.item_slot.miscs[slot_index].favor); } } break; case Item.CATEGORY.FOOD: { // 체력 회복. if (GameRoot.get().isNowCakeBiking()) { this.control.vital.healFullInternal(); } else { this.control.vital.healFull(); // 레인보우 칼러 효과. this.skin_color_control.startHealing(); } // 체력 회복을 알림. CharacterRoot.get().NotifyHitPoint(this.getAcountID(), this.control.vital.getHitPoint()); // 아이템 폐기를 알림. this.control.cmdItemDrop(query.target); // 케이크를 먹은 수(케이크 무한제공용). this.cake_count++; } break; // 방 열쇠. case Item.CATEGORY.KEY: { PartyControl.get().getLocalPlayer().control.consumeKey(item); Item.KEY_COLOR key_color = Item.Key.getColorFromInstanceName(item.name); // 아이템 창에 아이콘 표시. if (key_color != Item.KEY_COLOR.NONE) { ItemWindow.get().setItem(Item.SLOT_TYPE.KEY, (int)key_color, item.behavior.item_favor); } } break; // 플로어 이동 문 열쇠. case Item.CATEGORY.FLOOR_KEY: { MapCreator.getInstance().UnlockBossDoor(); // 아이템 창에 아이콘 표시. ItemWindow.get().setItem(Item.SLOT_TYPE.FLOOR_KEY, 0, item.behavior.item_favor); } break; case Item.CATEGORY.WEAPON: { // 샷 변경(대파 발칸 / 유자 폭탄). SHOT_TYPE shot_type = Item.Weapon.getShotType(item.name); if (shot_type != SHOT_TYPE.NONE) { this.changeBulletShooter(shot_type); } } break; } item.vanish(); } while(false); query.set_expired(true); }
public override void execute() { base.execute(); this.resolve_collision(); this.update_item_queries(); // ---------------------------------------------------------------- // // ?ㅼ쓬 ?곹깭濡??꾪솚?좎? 泥댄겕?쒕떎. switch (this.step.do_transition()) { // ?됱긽 ?? case STEP.MOVE: { if (this.control.vital.getHitPoint() <= 0.0f) { this.step.set_next(STEP.BATAN_Q); } } break; // 洹쇱젒 怨듦꺽. case STEP.MELEE_ATTACK: { if (!this.melee_attack.isAttacking()) { this.step.set_next(STEP.MOVE); } } break; // ?꾩씠???ъ슜. case STEP.USE_ITEM: { if (this.step_use_item.transition_check()) { this.ice_timer = ICE_DIGEST_TIME; } } break; // ?誘몄?瑜?諛쏆븘 ?좊씪媛??以? case STEP.BLOW_OUT: { // ?쇱젙 嫄곕━瑜??섏븘媛嫄곕굹 ??꾩븘?껋쑝濡?醫낅즺. float distance = MathUtility.calcDistanceXZ(this.control.getPosition(), this.step_blow_out.center); if (distance >= this.step_blow_out.radius || this.step.get_time() > BLOW_OUT_TIME) { this.control.cmdSetAcceptDamage(true); this.step.set_next(STEP.MOVE); } } break; // 泥대젰0. case STEP.BATAN_Q: { if (this.control.getMotion() == "") { this.control.cmdSetMotion("m007_out_lp", 1); this.step.set_next_delay(STEP.WAIT_RESTART, 1.0f); } } break; } // ---------------------------------------------------------------- // // ?곹깭 ?꾪솚 ??珥덇린?? while (this.step.get_next() != STEP.NONE) { switch (this.step.do_initialize()) { // ?됱긽 ?? case STEP.MOVE: { this.GetComponent <Rigidbody>().WakeUp(); this.move_target = this.transform.position; this.heading_target = this.transform.TransformPoint(Vector3.forward); } break; // 洹쇱젒 怨듦꺽. case STEP.MELEE_ATTACK: { this.melee_attack.setTarget(this.melee_target); this.melee_attack.attack(true); this.melee_target = null; } break; // ?꾩씠???ъ슜. case STEP.USE_ITEM: { int slot_index = this.step_use_item.slot_index; if (this.ice_timer > 0.0f) { // ?꾩씠?ㅻ? 吏㏃? 媛꾧꺽?쇰줈 ?곗냽 ?ъ슜???? // 癒몃━媛 吏?덉??덊빐???뚮났?섏? ?딅뒗?? // ?꾩씠?쒖쓣 ??젣?쒕떎. ItemWindow.get().clearItem(Item.SLOT_TYPE.MISC, slot_index); this.item_slot.miscs[slot_index].initialize(); this.startJinJin(); this.step.set_next(STEP.MOVE); SoundManager.getInstance().playSE(Sound.ID.DDG_SE_SYS06); } else { this.item_slot.miscs[slot_index].is_using = true; this.control.cmdSetAcceptDamage(false); this.step_use_item.initialize(); } } break; // ?誘몄?瑜?諛쏆븘 ?좊씪媛??以? case STEP.BLOW_OUT: { this.GetComponent <Rigidbody>().Sleep(); this.control.cmdSetAcceptDamage(false); } break; // 泥대젰 0 case STEP.BATAN_Q: { this.GetComponent <Rigidbody>().Sleep(); this.control.cmdSetAcceptDamage(false); this.control.cmdSetMotion("m006_out", 1); } break; // 由ъ뒪????湲? case STEP.WAIT_RESTART: { this.step_batan_q.tears_effect.destroy(); } break; // ?몃? ?쒖뼱. case STEP.OUTER_CONTROL: { this.GetComponent <Rigidbody>().Sleep(); } break; } } // ---------------------------------------------------------------- // // 媛??곹깭?먯꽌???ㅽ뻾 泥섎━. // 洹쇱젒 怨듦꺽. // ?쇰떒 false濡??대몢怨??대룞 ?낅젰???덉쓣 ?뚮쭔. // true濡??쒕떎. this.melee_attack.setHasInput(false); GameInput gi = GameInput.getInstance(); switch (this.step.do_execution(Time.deltaTime)) { // ?됱긽 ?? case STEP.MOVE: { this.exec_step_move(); // ?룔깾?껁깉. if (this.is_shot_enable) { this.bullet_shooter.execute(gi.shot.current); if (gi.shot.current) { CharacterRoot.get().SendAttackData(PartyControl.get().getLocalPlayer().getAcountID(), 0); } } // 泥대젰 ?뚮났 吏곹썑(?덉씤蹂댁슦而щ윭 以???臾댁쟻. if (this.skin_color_control.isNowHealing()) { this.control.cmdSetAcceptDamage(false); } else { this.control.cmdSetAcceptDamage(true); } } break; // ?꾩씠???ъ슜. case STEP.USE_ITEM: { this.step_use_item.execute(); } break; // ?誘몄?瑜?諛쏆븘 ?좊씪媛??以? case STEP.BLOW_OUT: { this.exec_step_blow_out(); } break; // 泥대젰0. case STEP.BATAN_Q: { if (this.step.is_acrossing_time(4.0f)) { this.step_batan_q.tears_effect = EffectRoot.get().createTearsEffect(this.control.getPosition()); this.step_batan_q.tears_effect.setParent(this.gameObject); this.step_batan_q.tears_effect.setLocalPosition(Vector3.up); } } break; } // ---------------------------------------------------------------- // if (gi.serif_text.trigger_on) { this.control.cmdQueryTalk(gi.serif_text.text, true); } // ---------------------------------------------------------------- // // 10 ?꾨젅?꾩뿉 ??踰?醫뚰몴瑜??ㅽ듃?뚰겕??蹂대궦?? { do { if (this.step.get_current() == STEP.OUTER_CONTROL) { break; } m_send_count = (m_send_count + 1) % SplineData.SEND_INTERVAL; if (m_send_count != 0 && m_culling.Count < PLOT_NUM) { break; } // ?듭떊??醫뚰몴 ?≪떊. Vector3 target = this.control.getPosition(); CharacterCoord coord = new CharacterCoord(target.x, target.z); Vector3 diff = m_prev - target; if (diff.sqrMagnitude > 0.0001f) { m_culling.Add(coord); AccountData account_data = AccountManager.get().getAccountData(GlobalParam.getInstance().global_account_id); CharacterRoot.get().SendCharacterCoord(account_data.avator_id, m_plotIndex, m_culling); ++m_plotIndex; if (m_culling.Count >= PLOT_NUM) { m_culling.RemoveAt(0); } m_prev = target; } } while(false); } }
public override void execute() { CameraControl camera = CameraControl.get(); // ---------------------------------------------------------------- // // 다음 상태로 이행할지 체크합니다.. switch (this.step.do_transition()) { // 이벤트 시작. case STEP.START: { this.step.set_next(STEP.OPEN_DOOR); //camera.module.parallelMoveTo(this.get_locator_position("cam_loc_0")); // 맵에 연관되지 않은 아이템은 가지고 돌아감. bool isPickingup = false; string current_map = MapCreator.get().getCurrentMapName(); ItemController itemYuzu = ItemManager.get().findItem("Yuzu"); if (itemYuzu != null && itemYuzu.isActive()) { if (current_map != itemYuzu.getProduction()) { // 가지고 돌아기는 아이템이 있었다. this.player.controll.cmdItemQueryPick(itemYuzu.name, true, true); isPickingup = true; } } ItemController itemNegi = ItemManager.get().findItem("Negi"); if (itemNegi != null && itemNegi.isActive()) { if (current_map != itemNegi.getProduction()) { // 가지고 돌아가는 아이템이 있었다. this.player.controll.cmdItemQueryPick(itemNegi.name, true, true); isPickingup = true; } } if (this.player.controll.item_carrier.isCarrying() && isPickingup == false) { ItemController item = this.player.controll.item_carrier.getItem(); if (item.isExportable() == false) { // 가지고 나갈 수 없는 것은 두고 갑니다. QueryItemDrop query_drop = this.player.controll.cmdItemQueryDrop(); query_drop.is_drop_done = true; this.player.controll.cmdItemDrop(this.player.controll.account_name); } } } break; // 배추가 옆으로 움직이고 & 대야가 등장. case STEP.OPEN_DOOR: { if (this.hakusai_fcurve.isDone() && this.tarai_fcurve.isDone()) { this.step.set_next(STEP.RIDE_TARAI_0); } } break; // 대야를 탑니다(기슭까지 걷는다). case STEP.RIDE_TARAI_0: { if (!this.player_move.isMoving()) { this.step.set_next(STEP.RIDE_TARAI_1); } } break; // 대야를 탑니다(대야를 향해 점프). case STEP.RIDE_TARAI_1: { if (!this.player_jump.isMoving()) { this.step.set_next(STEP.CLOSE_DOOR); } } break; // 배추가 돌아오고 & 대야가 밖을 향해 이동. case STEP.CLOSE_DOOR: { if (this.hakusai_fcurve.isDone() && this.tarai_fcurve.isDone()) { this.step.set_next(STEP.END); } } break; case STEP.END: { camera.module.popPosture(); this.step.set_next(STEP.IDLE); } break; } // ---------------------------------------------------------------- // // 상태가 전환할 때의 초기화. while (this.step.get_next() != STEP.NONE) { dbwin.console().print(this.step.ToString()); switch (this.step.do_initialize()) { // 이벤트 시작. case STEP.START: { camera.module.pushPosture(); this.player.beginOuterControll(); this.tarai_fune.transform.position = this.tarai_enter_spline.curve.cvs.front().position; } break; // 배추가 옆으로 움직이고 & 대야가 등장. case STEP.OPEN_DOOR: { this.hakusai_set.setControl(true); this.hakusai_fcurve.setSlopeAngle(10.0f, 10.0f); this.hakusai_fcurve.setDuration(4.0f); this.hakusai_fcurve.start(); this.hakusai_tracer.restart(); this.tarai_fcurve.setSlopeAngle(60.0f, 10.0f); this.tarai_fcurve.setDuration(2.0f); this.tarai_fcurve.setDelay(2.0f); this.tarai_fcurve.start(); } break; // 대야를 탑니다(기슭까지 걷는다). case STEP.RIDE_TARAI_0: { this.player_move.position.start = this.player.controll.getPosition(); this.player_move.position.goal = this.get_locator_position("chr_loc_0"); this.player_move.startConstantVelocity(chrBehaviorLocal.MOVE_SPEED); } break; // 대야를 탑니다(대야를 향해서 점프). case STEP.RIDE_TARAI_1: { Vector3 start = this.player.controll.getPosition(); Vector3 goal = this.tarai_enter_spline.curve.cvs.back().position; this.player_jump.start(start, goal, 1.0f); } break; // 배추가 돌아오고 & 대야가 밖을 향해 이동. case STEP.CLOSE_DOOR: { this.hakusai_fcurve.setSlopeAngle(10.0f, 10.0f); this.hakusai_fcurve.setDuration(4.0f); this.hakusai_fcurve.start(); this.hakusai_tracer.restart(); this.hakusai_tracer.setCurrentByDistance(this.hakusai_tracer.curve.calcTotalDistance()); this.tarai_tracer.attach(this.tarai_leave_spline.curve); this.tarai_tracer.restart(); this.tarai_fcurve.reset(); this.tarai_fcurve.setSlopeAngle(20.0f, 60.0f); this.tarai_fcurve.setDuration(2.0f); this.tarai_fcurve.start(); } break; case STEP.END: { // 이벤트 종료. this.hakusai_set.reset(); this.hakusai_set.setControl(false); if (this.is_local_player) { if (this.is_map_change) { GlobalParam.get().skip_enter_event = false; GlobalParam.get().fadein_start = false; if (GlobalParam.get().is_in_my_home) { GameRoot.get().step.set_next(GameRoot.STEP.VISIT); } else { GameRoot.get().step.set_next(GameRoot.STEP.GO_HOME); } // 정원 이동을 알림. if (GlobalParam.get().request_move_home) { Debug.Log("NotifyFieldMoving Leave END."); GameRoot.get().NotifyFieldMoving(); } } else { GlobalParam.get().is_in_my_home = !GlobalParam.get().is_in_my_home; this.player.controll.cmdSetPosition(this.initial_player_position); this.player.endOuterControll(); } } else { // 아이템을 비활성화하고 나서 드롭하지 않으면 재생합니다. ItemBehaviorFruit fruit = this.player.controll.getCarriedItem <ItemBehaviorFruit>(); if (fruit != null) { fruit.activeItem(false); } // 맵 이동이 없을 때 아이템을 가지고 돌아온 경우 아이템의 게임 오브젝트를. // 폐기하지 않게 하고자 아이템을 버립니다. this.player.controll.cmdItemDrop(this.player.name); CharacterRoot.get().deletaCharacter(this.player.controll); } this.player = null; } break; } } // ---------------------------------------------------------------- // // 각 상태에서의 실행 처리. switch (this.step.do_execution(Time.deltaTime)) { // 배추가 옆으로 움직이고 & 대야가 등장. case STEP.OPEN_DOOR: { this.hakusai_fcurve.execute(Time.deltaTime); this.hakusai_tracer.proceedToDistance(this.hakusai_tracer.curve.calcTotalDistance() * this.hakusai_fcurve.getValue()); this.hakusai_set.setPosition(this.hakusai_tracer.getCurrent().position); this.tarai_fcurve.execute(Time.deltaTime); this.tarai_tracer.proceedToDistance(this.tarai_tracer.curve.calcTotalDistance() * this.tarai_fcurve.getValue()); this.tarai_fune.setPosition(this.tarai_tracer.getCurrent().position); if (this.tarai_fcurve.isTriggerDone()) { this.ripple_effect.is_created = false; } } break; // 대야를 탑니다(기슭까지 걷는다). case STEP.RIDE_TARAI_0: { this.player_move.execute(Time.deltaTime); this.player.controll.cmdSetPosition(this.player_move.position.current); this.player.controll.cmdSmoothHeadingTo(this.player_move.position.goal); this.player.playWalkMotion(); } break; // 대야를 탑니다(대야를 향해서 점프). case STEP.RIDE_TARAI_1: { this.player_jump.execute(Time.deltaTime); this.player.controll.cmdSetPosition(this.player_jump.position); this.player.controll.cmdSmoothHeadingTo(this.player_jump.goal); this.player.stopWalkMotion(); if (this.player_jump.is_trigger_bounce && this.player_jump.bounce_count == 1) { this.ripple_effect.is_created = false; } } break; // 배추가 돌아오고 & 대야가 밖을 향해 이동. case STEP.CLOSE_DOOR: { this.hakusai_fcurve.execute(Time.deltaTime); this.hakusai_tracer.proceedToDistance(this.hakusai_tracer.curve.calcTotalDistance() * (1.0f - this.hakusai_fcurve.getValue())); this.hakusai_set.setPosition(this.hakusai_tracer.cv.position); this.tarai_fcurve.execute(Time.deltaTime); this.tarai_tracer.proceedToDistance(this.tarai_tracer.curve.calcTotalDistance() * this.tarai_fcurve.getValue()); SimpleSpline.ControlVertex cv = this.tarai_tracer.getCurrent(); this.tarai_fune.setPosition(cv.position); this.player.controll.cmdSetPosition(cv.position); this.player.controll.cmdSmoothHeadingTo(cv.position + cv.tangent.Y(0.0f)); this.player.stopWalkMotion(); } break; } // 대야 뒤에 나오는 물결. if (!this.ripple_effect.is_created || Vector3.Distance(this.ripple_effect.last_position, this.tarai_fune.getPosition()) > 2.0f) { this.ripple_effect.is_created = true; this.ripple_effect.last_position = this.tarai_fune.transform.position; EffectRoot.get().createRipple(this.ripple_effect.last_position); } // ---------------------------------------------------------------- // }
public override void execute() { CameraModule camera_module = CameraControl.get().getModule(); float ougi_pos_y0 = -3.2f; float ougi_pos_y1 = 0.0f; // ---------------------------------------------------------------- // // 다음 상태로 이동할지 체크. switch (this.step.do_transition()) { case STEP.START: { } break; // "!" 말풍선. case STEP.BIKKURI: { if (this.step.get_time() > 1.0f) { this.sprite_bikkuri.setVisible(false); this.step.set_next(STEP.TURN_AND_RISE); } } break; // 빙글 돌아 모션 재생. case STEP.TURN_AND_RISE: { if (this.step.get_time() > 2.0f) { this.step.set_next(STEP.STICK_THROW); } } break; // 아이스 스틱을 던진다. case STEP.STICK_THROW: { if (this.player.control.getMotionCurrentTime() > 0.3f) { this.step.set_next(STEP.STICK_FLYING); } } break; // 아이스 스틱이 날라온다. case STEP.STICK_FLYING: { if (!this.ice_fcurve.isMoving()) { ItemWindow.get().setItem(Item.SLOT_TYPE.MISC, this.slot_index, this.item_favor); this.player.item_slot.miscs[this.slot_index].is_using = false; this.step.set_next(STEP.END); } } break; case STEP.END: { this.step.set_next(STEP.IDLE); } break; } // ---------------------------------------------------------------- // // 상태 전환 시 초기화. while (this.step.get_next() != STEP.NONE) { switch (this.step.do_initialize()) { case STEP.START: { Vector3 player_position = this.player.control.getPosition(); // -------------------------------------------------------- // // 카메라. CameraControl.get().beginOuterControll(); camera_module.pushPosture(); this.cam_posture0 = camera_module.getPosture(); this.cam_posture1.position = player_position + new Vector3(0.0f, 5.3f, -3.5f); this.cam_posture1.intererst = player_position + Vector3.forward * 2.0f; this.cam_posture1.up = Vector3.up; this.camera_fcurve.setSlopeAngle(70.0f, 5.0f); this.camera_fcurve.setDuration(0.5f); this.camera_fcurve.start(); // 플레이어. this.player.beginOuterControll(); this.player.GetComponent <Rigidbody>().Sleep(); // 피라미 적 캐릭터의 움직임을 멈춘다. LevelControl.get().beginStillEnemies(); // this.step.set_next_delay(STEP.BIKKURI, 1.0f); } break; // "!" 말풍선. case STEP.BIKKURI: { this.bikkuri_spring.k = 750.0f; this.bikkuri_spring.reduce = 0.77f; this.bikkuri_spring.start(-2.75f); this.sprite_bikkuri.setVisible(true); } break; // 빙글 돌아 모션 재생. case STEP.TURN_AND_RISE: { // 뒤의 부채. this.ougi_position = this.player.control.getPosition() + Vector3.forward * 1.0f; this.ougi_position.y = ougi_pos_y0; this.ougi = EffectRoot.get().createAtariOugi(this.ougi_position); this.ougi_fcurve.setSlopeAngle(70.0f, 5.0f); this.ougi_fcurve.setDuration(0.5f); this.ougi_fcurve.start(); // 플레이어. if (this.player_weapon != null) { this.player_weapon.SetActive(false); } this.player.control.cmdSetMotion("m004_use", 1); // 아이스바 모델. this.ice_bar.SetActive(true); // 종을 울림. SoundManager.getInstance().playSE(Sound.ID.DDG_JINGLE04); // 플레이어 가까이 있는 적을 지운다. this.hide_enemies = LevelControl.get().getRoomEnemiesInRange(null, this.player.getPosition(), 2.0f); foreach (var enemy in this.hide_enemies) { enemy.damage_effect.startFadeOut(0.1f); } } break; // 아이스 스틱을 던진다. case STEP.STICK_THROW: { // 플레이어. this.player.control.cmdSetMotion("m003_attack", 1); } break; // 아이스 스틱이 날라온다. case STEP.STICK_FLYING: { this.cam_posture1 = camera_module.getPosture(); this.camera_fcurve.setSlopeAngle(10.0f, 5.0f); this.camera_fcurve.setDuration(1.0f); this.camera_fcurve.start(); // 당첨 말풍선. this.atari_fcurve.setSlopeAngle(50.0f, 30.0f); this.atari_fcurve.setDuration(0.5f); this.atari_fcurve.start(); // 뒤 부채. this.ougi_fcurve.setSlopeAngle(70.0f, 5.0f); this.ougi_fcurve.setDuration(1.0f); this.ougi_fcurve.start(); // 아이스. this.ice_fcurve.setSlopeAngle(60.0f, 20.0f); this.ice_fcurve.setDuration(1.0f); this.ice_fcurve.start(); this.sprite_ice_bar.setVisible(true); // 플레이어가 가진 아이스바(당첨). this.ice_bar.gameObject.destroy(); } break; case STEP.END: { GameObject.Destroy(this.ice_bar); if (this.player_weapon != null) { this.player_weapon.SetActive(true); } this.player.GetComponent <Rigidbody>().WakeUp(); this.player.endOuterControll(); this.sprite_bikkuri.destroy(); this.sprite_atari.destroy(); this.sprite_ice_bar.destroy(); this.ougi.destroy(); camera_module.popPosture(); CameraControl.get().endOuterControll(); // 피래미 적 캐릭터의 움직임을 재개한다. LevelControl.get().endStillEnemies(null, 2.0f); foreach (var enemy in this.hide_enemies) { enemy.damage_effect.startFadeIn(0.5f); } } break; } } // ---------------------------------------------------------------- // // 각 상태에서의 실행 처리. switch (this.step.do_execution(Time.deltaTime)) { // "!" 말풍선. case STEP.BIKKURI: { this.bikkuri_spring.execute(Time.deltaTime); Vector2 position = new Vector2(0.0f, 80.0f); position += Vector2.up * 8.0f * this.bikkuri_spring.position; this.sprite_bikkuri.setPosition(position); } break; // 빙글 돌아 모션 재생. case STEP.TURN_AND_RISE: { // -------------------------------------------------------- // // 카메라. this.camera_fcurve.execute(Time.deltaTime); if (this.camera_fcurve.isMoving()) { CameraModule.Posture posture = CameraModule.lerp(this.cam_posture0, this.cam_posture1, this.camera_fcurve.getValue()); camera_module.setPosture(posture); } else { float dolly = camera_module.getDistance(); camera_module.dolly(dolly * (1.0f - 0.05f * Time.deltaTime)); } // -------------------------------------------------------- // // 플레이어. this.player.control.cmdSmoothHeadingTo(CameraControl.get().transform.position); if (this.player.control.getMotionCurrentTime() > 0.5f) { this.player.control.getAnimationPlayer().Stop(); } // -------------------------------------------------------- // // 뒤의 부채. this.ougi_fcurve.execute(Time.deltaTime); this.ougi_position.y = Mathf.Lerp(ougi_pos_y0, ougi_pos_y1, this.ougi_fcurve.getValue()); this.ougi.transform.position = this.ougi_position; // -------------------------------------------------------- // // 플레이어가 가지고 있는 아이스바(당첨). // 카메라 방향으로 향한다. Vector3 dir = CameraControl.get().gameObject.getPosition() - this.ice_bar.getPosition(); this.ice_bar.setRotation(Quaternion.LookRotation(-dir.Y(0.0f), Quaternion.AngleAxis(20.0f, Vector3.forward) * Vector3.up)); // 줌 if (this.step.is_acrossing_time(0.3f)) { this.ice_zoom_fcurve.setSlopeAngle(70.0f, 5.0f); this.ice_zoom_fcurve.setDuration(0.3f); this.ice_zoom_fcurve.start(); } this.ice_zoom_fcurve.execute(Time.deltaTime); this.ice_bar.setLocalScale(Vector3.one * Mathf.Lerp(0.2f, 0.8f, this.ice_zoom_fcurve.getValue())); // -------------------------------------------------------- // // 당첨 말풍선. if (this.step.is_acrossing_time(0.3f)) { this.spring.k = 750.0f; this.spring.reduce = 0.87f; this.spring.start(-0.75f); this.sprite_atari.setVisible(true); } this.spring.execute(Time.deltaTime); float scale = this.spring.position + 1.0f; this.sprite_atari.setScale(new Vector2(scale, scale)); } break; // 아이스 스틱을 던진다. case STEP.STICK_THROW: { // -------------------------------------------------------- // // カメラ. float dolly = camera_module.getDistance(); camera_module.dolly(dolly * (1.0f - 0.05f * Time.deltaTime)); // -------------------------------------------------------- // // Vector3 dir = CameraControl.get().gameObject.getPosition() - this.player.gameObject.getPosition(); dir = Quaternion.AngleAxis(-90.0f, Vector3.up) * dir.Y(0.0f); this.player.control.cmdSmoothHeadingTo(this.player.gameObject.getPosition() + dir); } break; // 아이스 스틱이 날아온다. case STEP.STICK_FLYING: { // -------------------------------------------------------- // // 카메라. this.camera_fcurve.execute(Time.deltaTime); CameraModule.Posture posture = CameraModule.lerp(this.cam_posture1, this.cam_posture0, this.camera_fcurve.getValue()); camera_module.setPosture(posture); // -------------------------------------------------------- // // 당첨 말풍선. this.atari_fcurve.execute(Time.deltaTime); this.sprite_atari.setScale(Vector2.one * Mathf.Lerp(1.0f, 0.0f, this.atari_fcurve.getValue())); // -------------------------------------------------------- // // 뒤 풍선. this.ougi_fcurve.execute(Time.deltaTime); this.ougi_position.y = Mathf.Lerp(ougi_pos_y1, ougi_pos_y0, this.ougi_fcurve.getValue()); this.ougi.transform.position = this.ougi_position; // -------------------------------------------------------- // // 이쪽으로 날아오는 아이스 스틱. this.ice_fcurve.execute(Time.deltaTime); this.tracer.proceedToDistance(this.ice_fcurve.getValue() * this.tracer.curve.calcTotalDistance()); Vector2 on_curve_position = this.tracer.cv.position.xz() * 480.0f / 2.0f; // 커브의 종단점이 아이템 윈도의 아이콘 위치가 되도록 보정한다. do { if (this.slot_index < 0) { break; } if (this.ice_fcurve.getValue() <= 0.5f) { break; } float blend_rate = Mathf.InverseLerp(0.5f, 1.0f, this.ice_fcurve.getValue()); Vector2 icon_position = ItemWindow.get().getIconPosition(Item.SLOT_TYPE.MISC, this.slot_index); Vector2 curve_end = this.tracer.curve.cvs.back().position.xz() * 480.0f / 2.0f; on_curve_position += (icon_position - curve_end) * blend_rate; } while(false); this.sprite_ice_bar.setPosition(on_curve_position); this.sprite_ice_bar.setAngle(this.step.get_time() * 360.0f * 5.0f); this.sprite_ice_bar.getMaterial().SetFloat("_BlendRate", this.ice_fcurve.getValue()); } break; } }
void Update() { // ---------------------------------------------------------------- // // 다음 상태로 전환할지 체크한다. switch (this.step.do_transition()) { case STEP.WAIT_ENTER: { if (this.is_unlocked) { if (this.keyItemName == null) { if (this.entered_players.Count >= PartyControl.get().getPlayerCount()) { this.step.set_next(STEP.EVENT_IN_ACTION); PartyControl.get().clearDoorState(this.keyItemName); } } else { if (this.entered_players.Count > 0 && PartyControl.get().isDoorOpen(this.keyItemName)) { this.step.set_next(STEP.EVENT_IN_ACTION); PartyControl.get().clearDoorState(this.keyItemName); } } } } break; case STEP.EVENT_IN_ACTION: { } break; case STEP.WAIT_LEAVE: { if (this.entered_players.Count == 0) { this.step.set_next(STEP.WAIT_ENTER); } } break; } // ---------------------------------------------------------------- // // 상태 전환 시 초기화. while (this.step.get_next() != STEP.NONE) { switch (this.step.do_initialize()) { case STEP.SLEEP: { if (this.moji_effect != null) { this.moji_effect.gameObject.destroy(); this.moji_effect = null; } } break; case STEP.WAIT_ENTER: { if (this.is_unlocked) { if (this.moji_effect == null) { this.moji_effect = EffectRoot.get().createDoorMojisEffect(this.transform.position); } } } break; case STEP.WAIT_LEAVE: { if (this.moji_effect != null) { this.moji_effect.gameObject.destroy(); this.moji_effect = null; } } break; case STEP.EVENT_IN_ACTION: { TransportEvent transport_event = EventRoot.get().startEvent <TransportEvent>(); if (transport_event != null) { transport_event.setDoor(this); } else { Debug.LogWarning("Can't begin Transport Event"); } // 다음 방을 설정해 둔다. if (this.connect_to != null) { PartyControl.get().setNextRoom(this.connect_to.room); } } break; } } // ---------------------------------------------------------------- // // 각 상태에서의 실행 처리. switch (this.step.do_execution(Time.deltaTime)) { case STEP.WAIT_ENTER: { } break; } // ---------------------------------------------------------------- // }
private void resolve_pick_item_query(QueryItemPick query) { do { if (!query.isSuccess()) { break; } // ?꾩씠???⑤뒫留?蹂듭궗?섍퀬 ??젣?쒕떎. ItemController item = this.control.cmdItemPick(query, query.target); if (item == null) { break; } // ?④낵. EffectRoot.get().createItemGetEffect(this.control.getPosition()); SoundManager.get().playSE(Sound.ID.DDG_SE_SYS02); switch (item.behavior.item_favor.category) { case Item.CATEGORY.CANDY: { // ?꾩씠??李쎌뿉 ?꾩씠肄??쒖떆. this.item_slot.candy.favor = item.behavior.item_favor.clone(); ItemWindow.get().setItem(Item.SLOT_TYPE.CANDY, 0, this.item_slot.candy.favor); // ?룹쓽 ?쇱젙?쒓컙 ?뚯썙?? this.startShotBoost(); } break; case Item.CATEGORY.SODA_ICE: case Item.CATEGORY.ETC: { // 鍮??щ’???꾩씠???ㅼ젙. int slot_index = this.item_slot.getEmptyMiscSlot(); if (slot_index >= 0) { this.item_slot.miscs[slot_index].item_id = query.target; this.item_slot.miscs[slot_index].favor = item.behavior.item_favor.clone(); // ?꾩씠??李쎌뿉 ?꾩씠肄??쒖떆. ItemWindow.get().setItem(Item.SLOT_TYPE.MISC, slot_index, this.item_slot.miscs[slot_index].favor); } } break; case Item.CATEGORY.FOOD: { // 泥대젰 ?뚮났. if (GameRoot.get().isNowCakeBiking()) { this.control.vital.healFullInternal(); } else { this.control.vital.healFull(); // ?덉씤蹂댁슦 移쇰윭 ?④낵. this.skin_color_control.startHealing(); } // 泥대젰 ?뚮났???뚮┝. CharacterRoot.get().NotifyHitPoint(this.getAcountID(), this.control.vital.getHitPoint()); // ?꾩씠???먭린瑜??뚮┝. this.control.cmdItemDrop(query.target); // 耳?댄겕瑜?癒뱀? ??耳?댄겕 臾댄븳?쒓났??. this.cake_count++; } break; // 諛??댁뇿. case Item.CATEGORY.KEY: { PartyControl.get().getLocalPlayer().control.consumeKey(item); Item.KEY_COLOR key_color = Item.Key.getColorFromInstanceName(item.name); // ?꾩씠??李쎌뿉 ?꾩씠肄??쒖떆. if (key_color != Item.KEY_COLOR.NONE) { ItemWindow.get().setItem(Item.SLOT_TYPE.KEY, (int)key_color, item.behavior.item_favor); } } break; // ?뚮줈???대룞 臾??댁뇿. case Item.CATEGORY.FLOOR_KEY: { MapCreator.getInstance().UnlockBossDoor(); // ?꾩씠??李쎌뿉 ?꾩씠肄??쒖떆. ItemWindow.get().setItem(Item.SLOT_TYPE.FLOOR_KEY, 0, item.behavior.item_favor); } break; case Item.CATEGORY.WEAPON: { // ??蹂寃????諛쒖뭏 / ?좎옄 ??깂). SHOT_TYPE shot_type = Item.Weapon.getShotType(item.name); if (shot_type != SHOT_TYPE.NONE) { this.changeBulletShooter(shot_type); } } break; } item.vanish(); } while(false); query.set_expired(true); }
void Update() { this.resolve_collision(); float explode_time = 0.5f; // ---------------------------------------------------------------- // // 다음 상태로 전환할지 체크한다. switch (this.step.do_transition()) { case STEP.FLYING: { if (this.trigger_damage) { this.step.set_next(STEP.EXPLODE); } } break; case STEP.EXPLODE: { //if(this.explode_effect == null) { if (this.step.get_time() > explode_time) { this.step.set_next(STEP.END); } } break; } // ---------------------------------------------------------------- // // 상태 전환 시 초기화. while (this.step.get_next() != STEP.NONE) { switch (this.step.do_initialize()) { case STEP.FLYING: { } break; case STEP.EXPLODE: { this.model_node.renderer.enabled = false; this.explode_effect = EffectRoot.get().createYuzuExplode(this.gameObject.getPosition().Y(0.5f)); this.coli_node.setLocalScale(Vector3.one * this.max_radius * 0.0f); } break; case STEP.END: { this.gameObject.destroy(); } break; } } // ---------------------------------------------------------------- // // 각 상태에서의 실행 처리. switch (this.step.do_execution(Time.deltaTime)) { case STEP.FLYING: { // 이동. this.velocity += Physics.gravity * Time.deltaTime; this.transform.position += this.velocity * Time.deltaTime; } break; case STEP.EXPLODE: { float rate = this.step.get_time() / explode_time; float scale = rate * this.max_radius; this.coli_node.setLocalScale(Vector3.one * scale); // 폭풍과의 충돌. // 콜라이더가 바닥에 충돌하면 그 다음 폭풍이 충돌해도 OnTriggerEnter가. // 호출되지 않으므로 직접 조사한다. RaycastHit hit; if (Physics.SphereCast(this.transform.position, scale * this.coli_sphere_radius, Vector3.up, out hit, float.MinValue, LayerMask.GetMask("Enemy", "EnemyLair"))) { CollisionResult result = new CollisionResult(); result.object0 = this.gameObject; result.object1 = hit.collider.gameObject; result.is_trigger = true; this.collision_results.Add(result); } } break; } }
public override void execute() { base.execute(); this.resolve_collision(); this.update_item_queries(); // ---------------------------------------------------------------- // // 다음 상태로 전환할지 체크한다. switch (this.step.do_transition()) { // 평상 시. case STEP.MOVE: { if (this.control.vital.getHitPoint() <= 0.0f) { this.step.set_next(STEP.BATAN_Q); } } break; // 근접 공격. case STEP.MELEE_ATTACK: { if (!this.melee_attack.isAttacking()) { this.step.set_next(STEP.MOVE); } } break; // 아이템 사용. case STEP.USE_ITEM: { if (this.step_use_item.transition_check()) { this.ice_timer = ICE_DIGEST_TIME; } } break; // 대미지를 받아 날라가는 중. case STEP.BLOW_OUT: { // 일정 거리를 나아가거나 타임아웃으로 종료. float distance = MathUtility.calcDistanceXZ(this.control.getPosition(), this.step_blow_out.center); if (distance >= this.step_blow_out.radius || this.step.get_time() > BLOW_OUT_TIME) { this.control.cmdSetAcceptDamage(true); this.step.set_next(STEP.MOVE); } } break; // 체력0. case STEP.BATAN_Q: { if (this.control.getMotion() == "") { this.control.cmdSetMotion("m007_out_lp", 1); this.step.set_next_delay(STEP.WAIT_RESTART, 1.0f); } } break; } // ---------------------------------------------------------------- // // 상태 전환 시 초기화. while (this.step.get_next() != STEP.NONE) { switch (this.step.do_initialize()) { // 평상 시. case STEP.MOVE: { this.rigidbody.WakeUp(); this.move_target = this.transform.position; this.heading_target = this.transform.TransformPoint(Vector3.forward); } break; // 근접 공격. case STEP.MELEE_ATTACK: { this.melee_attack.setTarget(this.melee_target); this.melee_attack.attack(true); this.melee_target = null; } break; // 아이템 사용. case STEP.USE_ITEM: { int slot_index = this.step_use_item.slot_index; if (this.ice_timer > 0.0f) { // 아이스를 짧은 간격으로 연속 사용할 때 // 머리가 지끈지끈해서 회복되지 않는다. // 아이템을 삭제한다. ItemWindow.get().clearItem(Item.SLOT_TYPE.MISC, slot_index); this.item_slot.miscs[slot_index].initialize(); this.startJinJin(); this.step.set_next(STEP.MOVE); SoundManager.getInstance().playSE(Sound.ID.DDG_SE_SYS06); } else { this.item_slot.miscs[slot_index].is_using = true; this.control.cmdSetAcceptDamage(false); this.step_use_item.initialize(); } } break; // 대미지를 받아 날라가는 중. case STEP.BLOW_OUT: { this.rigidbody.Sleep(); this.control.cmdSetAcceptDamage(false); } break; // 체력 0 case STEP.BATAN_Q: { this.rigidbody.Sleep(); this.control.cmdSetAcceptDamage(false); this.control.cmdSetMotion("m006_out", 1); } break; // 리스타트 대기. case STEP.WAIT_RESTART: { this.step_batan_q.tears_effect.destroy(); } break; // 외부 제어. case STEP.OUTER_CONTROL: { this.rigidbody.Sleep(); } break; } } // ---------------------------------------------------------------- // // 각 상태에서의 실행 처리. // 근접 공격. // 일단 false로 해두고 이동 입력이 있을 때만. // true로 한다. this.melee_attack.setHasInput(false); GameInput gi = GameInput.getInstance(); switch (this.step.do_execution(Time.deltaTime)) { // 평상 시. case STEP.MOVE: { this.exec_step_move(); // ショット. if (this.is_shot_enable) { this.bullet_shooter.execute(gi.shot.current); if (gi.shot.current) { CharacterRoot.get().SendAttackData(PartyControl.get().getLocalPlayer().getAcountID(), 0); } } // 체력 회복 직후(레인보우컬러 중)는 무적. if (this.skin_color_control.isNowHealing()) { this.control.cmdSetAcceptDamage(false); } else { this.control.cmdSetAcceptDamage(true); } } break; // 아이템 사용. case STEP.USE_ITEM: { this.step_use_item.execute(); } break; // 대미지를 받아 날라가는 중. case STEP.BLOW_OUT: { this.exec_step_blow_out(); } break; // 체력0. case STEP.BATAN_Q: { if (this.step.is_acrossing_time(4.0f)) { this.step_batan_q.tears_effect = EffectRoot.get().createTearsEffect(this.control.getPosition()); this.step_batan_q.tears_effect.setParent(this.gameObject); this.step_batan_q.tears_effect.setLocalPosition(Vector3.up); } } break; } // ---------------------------------------------------------------- // if (gi.serif_text.trigger_on) { this.control.cmdQueryTalk(gi.serif_text.text, true); } // ---------------------------------------------------------------- // // 10 프레임에 한 번 좌표를 네트워크에 보낸다. { do { if (this.step.get_current() == STEP.OUTER_CONTROL) { break; } m_send_count = (m_send_count + 1) % SplineData.SEND_INTERVAL; if (m_send_count != 0 && m_culling.Count < PLOT_NUM) { break; } // 통신용 좌표 송신. Vector3 target = this.control.getPosition(); CharacterCoord coord = new CharacterCoord(target.x, target.z); Vector3 diff = m_prev - target; if (diff.sqrMagnitude > 0.0001f) { m_culling.Add(coord); AccountData account_data = AccountManager.get().getAccountData(GlobalParam.getInstance().global_account_id); CharacterRoot.get().SendCharacterCoord(account_data.avator_id, m_plotIndex, m_culling); ++m_plotIndex; if (m_culling.Count >= PLOT_NUM) { m_culling.RemoveAt(0); } m_prev = target; } } while(false); } }