private static void gmGmkSeesawStart(AppMain.OBS_OBJECT_WORK obj_work) { AppMain.GMS_GMK_SEESAW_WORK gmsGmkSeesawWork = (AppMain.GMS_GMK_SEESAW_WORK)obj_work; gmsGmkSeesawWork.gmk_work.ene_com.rect_work[1].flag &= 4294967291U; AppMain.OBS_RECT_WORK pRec1 = gmsGmkSeesawWork.gmk_work.ene_com.rect_work[2]; pRec1.ppDef = (AppMain.OBS_RECT_WORK_Delegate1)null; pRec1.ppHit = (AppMain.OBS_RECT_WORK_Delegate1)null; AppMain.ObjRectAtkSet(pRec1, (ushort)0, (short)0); AppMain.ObjRectDefSet(pRec1, (ushort)65534, (short)0); AppMain.ObjRectWorkSet(pRec1, (short)-48, (short)-24, (short)48, (short)0); AppMain.OBS_RECT_WORK pRec2 = gmsGmkSeesawWork.gmk_work.ene_com.rect_work[0]; pRec2.flag |= 4U; pRec2.ppDef = (AppMain.OBS_RECT_WORK_Delegate1)null; pRec2.ppHit = (AppMain.OBS_RECT_WORK_Delegate1)null; AppMain.ObjRectWorkSet(pRec2, (short)-2, (short)-2, (short)2, (short)2); obj_work.flag &= 4294967293U; gmsGmkSeesawWork.initial_tilt = gmsGmkSeesawWork.tilt; gmsGmkSeesawWork.tilt_d = (short)0; gmsGmkSeesawWork.tilt_se_timer = (short)0; if (AppMain.seesaw_alive[(int)gmsGmkSeesawWork.seesaw_id] == (short)0) { AppMain.seesaw_tilt[(int)gmsGmkSeesawWork.seesaw_id] = gmsGmkSeesawWork.tilt; } else { gmsGmkSeesawWork.tilt = AppMain.seesaw_tilt[(int)gmsGmkSeesawWork.seesaw_id]; } obj_work.dir.z = (ushort)gmsGmkSeesawWork.tilt; ++AppMain.seesaw_alive[(int)gmsGmkSeesawWork.seesaw_id]; AppMain.mtTaskChangeTcbDestructor(obj_work.tcb, new AppMain.GSF_TASK_PROCEDURE(AppMain.gmGmkSeesawExitTCB)); obj_work.ppFunc = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmGmkSeesawStay); }
// Token: 0x060017AD RID: 6061 RVA: 0x000D1C9C File Offset: 0x000CFE9C private static void gmGmkSeesaw_PlayerHold(OBS_OBJECT_WORK obj_work) { AppMain.GMS_GMK_SEESAW_WORK gms_GMK_SEESAW_WORK = (AppMain.GMS_GMK_SEESAW_WORK)obj_work; GMS_PLAYER_WORK ply_work = gms_GMK_SEESAW_WORK.ply_work; if (AppMain.control_right != null) { if ((AppMain.control_right.gmk_work.ene_com.obj_work.pos.x >= obj_work.pos.x && ply_work.obj_work.spd.x >= 0) || (AppMain.control_right.gmk_work.ene_com.obj_work.pos.x <= obj_work.pos.x && ply_work.obj_work.spd.x <= 0)) { obj_work.ppFunc = AppMain.gmGmkSeesawStay; AppMain.gmGmkSeesawStay(obj_work); return; } gms_GMK_SEESAW_WORK.player_speed = AppMain.control_right.player_speed; } else { gms_GMK_SEESAW_WORK.player_speed = ply_work.obj_work.move.x / 2; } AppMain.GmPlySeqGmkInitSeesaw(ply_work, gms_GMK_SEESAW_WORK.gmk_work.ene_com); long num = (long)((long)(gms_GMK_SEESAW_WORK.hold_x - obj_work.pos.x) << 12); num /= ( long )AppMain.mtMathCos(( int )gms_GMK_SEESAW_WORK.tilt); gms_GMK_SEESAW_WORK.player_distance = num; AppMain.control_right = gms_GMK_SEESAW_WORK; obj_work.ppFunc = AppMain.gmGmkSeesaw_PlayerHold_100; AppMain.gmGmkSeesaw_PlayerHold_100(obj_work); }
// Token: 0x060017AB RID: 6059 RVA: 0x000D161C File Offset: 0x000CF81C private static void gmGmkSeesawStart(OBS_OBJECT_WORK obj_work) { AppMain.GMS_GMK_SEESAW_WORK gms_GMK_SEESAW_WORK = (AppMain.GMS_GMK_SEESAW_WORK)obj_work; gms_GMK_SEESAW_WORK.gmk_work.ene_com.rect_work[1].flag &= 4294967291U; AppMain.OBS_RECT_WORK obs_RECT_WORK = gms_GMK_SEESAW_WORK.gmk_work.ene_com.rect_work[2]; obs_RECT_WORK.ppDef = null; obs_RECT_WORK.ppHit = null; AppMain.ObjRectAtkSet(obs_RECT_WORK, 0, 0); AppMain.ObjRectDefSet(obs_RECT_WORK, 65534, 0); AppMain.ObjRectWorkSet(obs_RECT_WORK, -48, -24, 48, 0); obs_RECT_WORK = gms_GMK_SEESAW_WORK.gmk_work.ene_com.rect_work[0]; obs_RECT_WORK.flag |= 4U; obs_RECT_WORK.ppDef = null; obs_RECT_WORK.ppHit = null; AppMain.ObjRectWorkSet(obs_RECT_WORK, -2, -2, 2, 2); obj_work.flag &= 4294967293U; gms_GMK_SEESAW_WORK.initial_tilt = gms_GMK_SEESAW_WORK.tilt; gms_GMK_SEESAW_WORK.tilt_d = 0; gms_GMK_SEESAW_WORK.tilt_se_timer = 0; if (AppMain.seesaw_alive[( int )gms_GMK_SEESAW_WORK.seesaw_id] == 0) { AppMain.seesaw_tilt[( int )gms_GMK_SEESAW_WORK.seesaw_id] = gms_GMK_SEESAW_WORK.tilt; } else { gms_GMK_SEESAW_WORK.tilt = AppMain.seesaw_tilt[( int )gms_GMK_SEESAW_WORK.seesaw_id]; } obj_work.dir.z = ( ushort )gms_GMK_SEESAW_WORK.tilt; short[] array = AppMain.seesaw_alive; ushort seesaw_id = gms_GMK_SEESAW_WORK.seesaw_id; array[( int )seesaw_id] = ( short )(array[( int )seesaw_id] + 1); AppMain.mtTaskChangeTcbDestructor(obj_work.tcb, AppMain.gmGmkSeesawExitTCB); obj_work.ppFunc = AppMain.gmGmkSeesawStay; }
// Token: 0x060017A7 RID: 6055 RVA: 0x000D1510 File Offset: 0x000CF710 private static OBS_OBJECT_WORK GmGmkSeesaw330Init(AppMain.GMS_EVE_RECORD_EVENT eve_rec, int pos_x, int pos_y, byte type) { AppMain.GMS_GMK_SEESAW_WORK gms_GMK_SEESAW_WORK = AppMain.gmGmkSeesawInit(eve_rec, pos_x, pos_y, type); gms_GMK_SEESAW_WORK.tilt = -4608; AppMain.gmGmkSeesawStart(gms_GMK_SEESAW_WORK.gmk_work.ene_com.obj_work); return(gms_GMK_SEESAW_WORK.gmk_work.ene_com.obj_work); }
private static void gmGmkSeesaw_PlayerHold(AppMain.OBS_OBJECT_WORK obj_work) { AppMain.GMS_GMK_SEESAW_WORK gmsGmkSeesawWork = (AppMain.GMS_GMK_SEESAW_WORK)obj_work; AppMain.GMS_PLAYER_WORK plyWork = gmsGmkSeesawWork.ply_work; if (AppMain.control_right != null) { if (AppMain.control_right.gmk_work.ene_com.obj_work.pos.x >= obj_work.pos.x && plyWork.obj_work.spd.x >= 0 || AppMain.control_right.gmk_work.ene_com.obj_work.pos.x <= obj_work.pos.x && plyWork.obj_work.spd.x <= 0) { obj_work.ppFunc = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmGmkSeesawStay); AppMain.gmGmkSeesawStay(obj_work); return; } gmsGmkSeesawWork.player_speed = AppMain.control_right.player_speed; } else { gmsGmkSeesawWork.player_speed = plyWork.obj_work.move.x / 2; } AppMain.GmPlySeqGmkInitSeesaw(plyWork, gmsGmkSeesawWork.gmk_work.ene_com); long num = (long)(gmsGmkSeesawWork.hold_x - obj_work.pos.x << 12) / (long)AppMain.mtMathCos((int)gmsGmkSeesawWork.tilt); gmsGmkSeesawWork.player_distance = num; AppMain.control_right = gmsGmkSeesawWork; obj_work.ppFunc = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmGmkSeesaw_PlayerHold_100); AppMain.gmGmkSeesaw_PlayerHold_100(obj_work); }
private static void gmGmkSeesawExitTCB(AppMain.MTS_TASK_TCB tcb) { AppMain.GMS_GMK_SEESAW_WORK tcbWork = (AppMain.GMS_GMK_SEESAW_WORK)AppMain.mtTaskGetTcbWork(tcb); --AppMain.seesaw_alive[(int)tcbWork.seesaw_id]; if (AppMain.control_right == tcbWork) { AppMain.control_right = (AppMain.GMS_GMK_SEESAW_WORK)null; AppMain.lock_seesaw_id = (ushort)0; } AppMain.GmEnemyDefaultExit(tcb); }
private static AppMain.OBS_OBJECT_WORK GmGmkSeesaw0Init( AppMain.GMS_EVE_RECORD_EVENT eve_rec, int pos_x, int pos_y, byte type) { AppMain.GMS_GMK_SEESAW_WORK gmsGmkSeesawWork = AppMain.gmGmkSeesawInit(eve_rec, pos_x, pos_y, type); gmsGmkSeesawWork.tilt = (short)0; AppMain.gmGmkSeesawStart(gmsGmkSeesawWork.gmk_work.ene_com.obj_work); return(gmsGmkSeesawWork.gmk_work.ene_com.obj_work); }
// Token: 0x060017AA RID: 6058 RVA: 0x000D15C8 File Offset: 0x000CF7C8 private static void gmGmkSeesawExitTCB(MTS_TASK_TCB tcb) { AppMain.GMS_GMK_SEESAW_WORK gms_GMK_SEESAW_WORK = (AppMain.GMS_GMK_SEESAW_WORK)AppMain.mtTaskGetTcbWork(tcb); short[] array = AppMain.seesaw_alive; ushort seesaw_id = gms_GMK_SEESAW_WORK.seesaw_id; array[( int )seesaw_id] = ( short )(array[( int )seesaw_id] - 1); if (AppMain.control_right == gms_GMK_SEESAW_WORK) { AppMain.control_right = null; AppMain.lock_seesaw_id = 0; } AppMain.GmEnemyDefaultExit(tcb); }
// Token: 0x060017B0 RID: 6064 RVA: 0x000D22F4 File Offset: 0x000D04F4 private static AppMain.GMS_GMK_SEESAW_WORK gmGmkSeesawInit(AppMain.GMS_EVE_RECORD_EVENT eve_rec, int pos_x, int pos_y, byte type) { AppMain.UNREFERENCED_PARAMETER(type); AppMain.GMS_GMK_SEESAW_WORK gms_GMK_SEESAW_WORK = (AppMain.GMS_GMK_SEESAW_WORK)AppMain.GMM_ENEMY_CREATE_WORK(eve_rec, pos_x, pos_y, () => new AppMain.GMS_GMK_SEESAW_WORK(), "Gmk_Seesaw"); AppMain.OBS_OBJECT_WORK obs_OBJECT_WORK = (AppMain.OBS_OBJECT_WORK)gms_GMK_SEESAW_WORK; AppMain.GMS_ENEMY_3D_WORK gms_ENEMY_3D_WORK = (AppMain.GMS_ENEMY_3D_WORK)gms_GMK_SEESAW_WORK; AppMain.ObjObjectCopyAction3dNNModel(obs_OBJECT_WORK, AppMain.gm_gmk_seesaw_obj_3d_list[0], gms_ENEMY_3D_WORK.obj_3d); obs_OBJECT_WORK.pos.z = -4096; obs_OBJECT_WORK.move_flag |= 256U; obs_OBJECT_WORK.disp_flag |= 4194304U; gms_GMK_SEESAW_WORK.seesaw_id = ( ushort )eve_rec.left; AppMain.gmGmkSeesaw_CreateParts(gms_GMK_SEESAW_WORK); return(gms_GMK_SEESAW_WORK); }
private static void gmGmkSeesaw_CreateParts(AppMain.GMS_GMK_SEESAW_WORK pwork) { AppMain.OBS_OBJECT_WORK obsObjectWork = (AppMain.OBS_OBJECT_WORK)pwork; AppMain.OBS_OBJECT_WORK work = AppMain.GMM_EFFECT_CREATE_WORK((AppMain.TaskWorkFactoryDelegate)(() => (object)new AppMain.GMS_GMK_SEESAWPARTS_WORK()), (AppMain.OBS_OBJECT_WORK)null, (ushort)0, "Gmk_SeesawParts"); AppMain.GMS_GMK_SEESAWPARTS_WORK gmkSeesawpartsWork = (AppMain.GMS_GMK_SEESAWPARTS_WORK)work; AppMain.ObjObjectCopyAction3dNNModel(work, AppMain.gm_gmk_seesaw_obj_3d_list[1], gmkSeesawpartsWork.eff_work.obj_3d); work.parent_obj = obsObjectWork; work.flag &= 4294966271U; work.pos.x = obsObjectWork.pos.x; work.pos.y = obsObjectWork.pos.y; work.pos.z = obsObjectWork.pos.z + 4096; work.disp_flag |= 4194304U; work.disp_flag |= 256U; work.flag |= 2U; work.ppFunc = (AppMain.MPP_VOID_OBS_OBJECT_WORK)null; }
// Token: 0x060017AF RID: 6063 RVA: 0x000D21F4 File Offset: 0x000D03F4 private static void gmGmkSeesaw_CreateParts(AppMain.GMS_GMK_SEESAW_WORK pwork) { AppMain.OBS_OBJECT_WORK obs_OBJECT_WORK = (AppMain.OBS_OBJECT_WORK)pwork; AppMain.OBS_OBJECT_WORK obs_OBJECT_WORK2 = AppMain.GMM_EFFECT_CREATE_WORK(() => new AppMain.GMS_GMK_SEESAWPARTS_WORK(), null, 0, "Gmk_SeesawParts"); AppMain.GMS_GMK_SEESAWPARTS_WORK gms_GMK_SEESAWPARTS_WORK = (AppMain.GMS_GMK_SEESAWPARTS_WORK)obs_OBJECT_WORK2; AppMain.ObjObjectCopyAction3dNNModel(obs_OBJECT_WORK2, AppMain.gm_gmk_seesaw_obj_3d_list[1], gms_GMK_SEESAWPARTS_WORK.eff_work.obj_3d); obs_OBJECT_WORK2.parent_obj = obs_OBJECT_WORK; obs_OBJECT_WORK2.flag &= 4294966271U; obs_OBJECT_WORK2.pos.x = obs_OBJECT_WORK.pos.x; obs_OBJECT_WORK2.pos.y = obs_OBJECT_WORK.pos.y; obs_OBJECT_WORK2.pos.z = obs_OBJECT_WORK.pos.z + 4096; obs_OBJECT_WORK2.disp_flag |= 4194304U; obs_OBJECT_WORK2.disp_flag |= 256U; obs_OBJECT_WORK2.flag |= 2U; obs_OBJECT_WORK2.ppFunc = null; }
private static AppMain.GMS_GMK_SEESAW_WORK gmGmkSeesawInit( AppMain.GMS_EVE_RECORD_EVENT eve_rec, int pos_x, int pos_y, byte type) { AppMain.UNREFERENCED_PARAMETER((object)type); AppMain.GMS_GMK_SEESAW_WORK work = (AppMain.GMS_GMK_SEESAW_WORK)AppMain.GMM_ENEMY_CREATE_WORK(eve_rec, pos_x, pos_y, (AppMain.TaskWorkFactoryDelegate)(() => (object)new AppMain.GMS_GMK_SEESAW_WORK()), "Gmk_Seesaw"); AppMain.OBS_OBJECT_WORK obj_work = (AppMain.OBS_OBJECT_WORK)work; AppMain.GMS_ENEMY_3D_WORK gmsEnemy3DWork = (AppMain.GMS_ENEMY_3D_WORK)work; AppMain.ObjObjectCopyAction3dNNModel(obj_work, AppMain.gm_gmk_seesaw_obj_3d_list[0], gmsEnemy3DWork.obj_3d); obj_work.pos.z = -4096; obj_work.move_flag |= 256U; obj_work.disp_flag |= 4194304U; work.seesaw_id = (ushort)eve_rec.left; AppMain.gmGmkSeesaw_CreateParts(work); return(work); }
// Token: 0x060017AE RID: 6062 RVA: 0x000D1DDC File Offset: 0x000CFFDC private static void gmGmkSeesaw_PlayerHold_100(OBS_OBJECT_WORK obj_work) { AppMain.GMS_GMK_SEESAW_WORK gms_GMK_SEESAW_WORK = (AppMain.GMS_GMK_SEESAW_WORK)obj_work; GMS_PLAYER_WORK ply_work = gms_GMK_SEESAW_WORK.ply_work; AppMain.lock_seesaw_id = 0; if (ply_work.seq_state != 44 || AppMain.control_right != gms_GMK_SEESAW_WORK || (ply_work.obj_work.move_flag & 256U) != 0U) { gms_GMK_SEESAW_WORK.tilt_d = 0; gms_GMK_SEESAW_WORK.tilt_se_timer = 0; if (AppMain.control_right == gms_GMK_SEESAW_WORK) { AppMain.control_right = null; } obj_work.ppFunc = AppMain.gmGmkSeesawStay; AppMain.gmGmkSeesawStay(obj_work); return; } AppMain.lock_seesaw_id = gms_GMK_SEESAW_WORK.seesaw_id; gms_GMK_SEESAW_WORK.tilt_timer = 60; AppMain.control_right = gms_GMK_SEESAW_WORK; int num = GmPlayer.KeyGetGimmickRotZ(gms_GMK_SEESAW_WORK.ply_work); if (num > 256) { num = 256; } if (num < -256) { num = -256; } gms_GMK_SEESAW_WORK.tilt_d = ( short )num; if (gms_GMK_SEESAW_WORK.tilt_d != 0) { AppMain.GMS_GMK_SEESAW_WORK gms_GMK_SEESAW_WORK2 = gms_GMK_SEESAW_WORK; gms_GMK_SEESAW_WORK2.tilt += gms_GMK_SEESAW_WORK.tilt_d; if (gms_GMK_SEESAW_WORK.tilt_se_timer == 0) { GmSound.PlaySE("Seesaw"); gms_GMK_SEESAW_WORK.tilt_se_timer = 8; } AppMain.GMS_GMK_SEESAW_WORK gms_GMK_SEESAW_WORK3 = gms_GMK_SEESAW_WORK; gms_GMK_SEESAW_WORK3.tilt_se_timer -= 1; if (gms_GMK_SEESAW_WORK.tilt >= 4608) { gms_GMK_SEESAW_WORK.tilt = 4608; gms_GMK_SEESAW_WORK.tilt_d = 0; } if (gms_GMK_SEESAW_WORK.tilt <= -4608) { gms_GMK_SEESAW_WORK.tilt = -4608; gms_GMK_SEESAW_WORK.tilt_d = 0; } } obj_work.dir.z = ( ushort )gms_GMK_SEESAW_WORK.tilt; AppMain.seesaw_tilt[( int )gms_GMK_SEESAW_WORK.seesaw_id] = ( short )obj_work.dir.z; if ((ply_work.obj_work.move_flag & 4U) != 0U) { int num2 = AppMain.mtMathSin((int)((ushort)gms_GMK_SEESAW_WORK.tilt)) * 29; num2 = obj_work.pos.x + num2; num2 = ply_work.obj_work.pos.x - num2; long num3 = (long)((long)num2 << 12); num3 /= ( long )AppMain.mtMathCos(( int )gms_GMK_SEESAW_WORK.tilt); gms_GMK_SEESAW_WORK.player_distance = num3; if (((ply_work.obj_work.disp_flag & 1U) == 0U && gms_GMK_SEESAW_WORK.player_speed > 0) || ((ply_work.obj_work.disp_flag & 1U) != 0U && gms_GMK_SEESAW_WORK.player_speed < 0)) { gms_GMK_SEESAW_WORK.player_speed = 0; } } long num4 = gms_GMK_SEESAW_WORK.player_distance; gms_GMK_SEESAW_WORK.player_distance += ( long )gms_GMK_SEESAW_WORK.player_speed; num4 = gms_GMK_SEESAW_WORK.player_distance - num4; gms_GMK_SEESAW_WORK.player_speed += 256 * AppMain.mtMathSin(( int )(( ushort )gms_GMK_SEESAW_WORK.tilt)) >> 12; int num5 = AppMain.mtMathSin((int)((ushort)gms_GMK_SEESAW_WORK.tilt)) * 29; num5 = obj_work.pos.x + num5; int num6 = AppMain.mtMathCos((int)((ushort)gms_GMK_SEESAW_WORK.tilt)) * 29; num6 = obj_work.pos.y - num6; int num7 = (int)(gms_GMK_SEESAW_WORK.player_distance * (long)AppMain.mtMathCos((int)((ushort)gms_GMK_SEESAW_WORK.tilt)) >> 12); num7 = num5 + num7; int num8 = (int)(gms_GMK_SEESAW_WORK.player_distance * (long)AppMain.mtMathSin((int)((ushort)gms_GMK_SEESAW_WORK.tilt)) >> 12); num8 = num6 + num8; if (gms_GMK_SEESAW_WORK.player_speed < 0 && (ply_work.obj_work.disp_flag & 1U) == 0U) { ply_work.obj_work.disp_flag |= 1U; } else if (gms_GMK_SEESAW_WORK.player_speed > 0 && (ply_work.obj_work.disp_flag & 1U) != 0U) { ply_work.obj_work.disp_flag &= 4294967294U; } if (gms_GMK_SEESAW_WORK.player_distance <= 231424L && gms_GMK_SEESAW_WORK.player_distance >= -231424L) { ply_work.obj_work.spd.x = num7 - ply_work.obj_work.pos.x; ply_work.obj_work.spd.y = num8 - ply_work.obj_work.pos.y; return; } int num9 = (int)(num4 * (long)AppMain.mtMathCos((int)((ushort)gms_GMK_SEESAW_WORK.tilt)) >> 12); int spdy = (int)(num4 * (long)AppMain.mtMathSin((int)((ushort)gms_GMK_SEESAW_WORK.tilt)) >> 12); if (AppMain.MTM_MATH_ABS(num9) < 256) { if (num9 < 0) { num9 = -1024; } else { num9 = 1024; } } AppMain.GmPlySeqGmkInitSeesawEnd(ply_work, num9, spdy); gms_GMK_SEESAW_WORK.tilt_d = 0; AppMain.control_right = null; AppMain.lock_seesaw_id = 0; obj_work.ppFunc = AppMain.gmGmkSeesawStay; }
// Token: 0x060017AC RID: 6060 RVA: 0x000D1788 File Offset: 0x000CF988 private static void gmGmkSeesawStay(OBS_OBJECT_WORK obj_work) { AppMain.GMS_GMK_SEESAW_WORK gms_GMK_SEESAW_WORK = (AppMain.GMS_GMK_SEESAW_WORK)obj_work; GMS_PLAYER_WORK gms_PLAYER_WORK = AppMain.g_gm_main_system.ply_work[(int)((UIntPtr)0)]; if (AppMain.lock_seesaw_id == gms_GMK_SEESAW_WORK.seesaw_id) { gms_GMK_SEESAW_WORK.tilt = AppMain.seesaw_tilt[( int )gms_GMK_SEESAW_WORK.seesaw_id]; obj_work.dir.z = ( ushort )gms_GMK_SEESAW_WORK.tilt; gms_GMK_SEESAW_WORK.tilt_timer = 60; } else if (gms_GMK_SEESAW_WORK.tilt != gms_GMK_SEESAW_WORK.initial_tilt) { if (gms_GMK_SEESAW_WORK.tilt_timer <= 0) { if (gms_GMK_SEESAW_WORK.tilt > gms_GMK_SEESAW_WORK.initial_tilt) { AppMain.GMS_GMK_SEESAW_WORK gms_GMK_SEESAW_WORK2 = gms_GMK_SEESAW_WORK; gms_GMK_SEESAW_WORK2.tilt -= 256; if (gms_GMK_SEESAW_WORK.tilt < gms_GMK_SEESAW_WORK.initial_tilt) { gms_GMK_SEESAW_WORK.tilt = gms_GMK_SEESAW_WORK.initial_tilt; } } else if (gms_GMK_SEESAW_WORK.tilt < gms_GMK_SEESAW_WORK.initial_tilt) { AppMain.GMS_GMK_SEESAW_WORK gms_GMK_SEESAW_WORK3 = gms_GMK_SEESAW_WORK; gms_GMK_SEESAW_WORK3.tilt += 256; if (gms_GMK_SEESAW_WORK.tilt > gms_GMK_SEESAW_WORK.initial_tilt) { gms_GMK_SEESAW_WORK.tilt = gms_GMK_SEESAW_WORK.initial_tilt; } } } else { AppMain.GMS_GMK_SEESAW_WORK gms_GMK_SEESAW_WORK4 = gms_GMK_SEESAW_WORK; gms_GMK_SEESAW_WORK4.tilt_timer -= 1; } } obj_work.dir.z = ( ushort )gms_GMK_SEESAW_WORK.tilt; if (gms_GMK_SEESAW_WORK.tilt == 0) { gms_GMK_SEESAW_WORK.tilt = 0; } if ((gms_PLAYER_WORK.player_flag & 1024U) != 0U || (gms_PLAYER_WORK.obj_work.flag & 2U) != 0U || ((gms_PLAYER_WORK.obj_work.move_flag & 16U) != 0U && gms_PLAYER_WORK.obj_work.spd.y < 0)) { return; } int num = AppMain.mtMathSin((int)((ushort)gms_GMK_SEESAW_WORK.tilt)) * 29; int num2 = AppMain.mtMathCos((int)((ushort)gms_GMK_SEESAW_WORK.tilt)) * 29; int num3 = AppMain.mtMathCos((int)((ushort)gms_GMK_SEESAW_WORK.tilt)) * 112 / 2; int num4 = AppMain.MTM_MATH_ABS(AppMain.mtMathSin((int)((ushort)gms_GMK_SEESAW_WORK.tilt)) * 112 / 2); int num5 = gms_PLAYER_WORK.obj_work.pos.x - obj_work.pos.x; if (num5 >= -(num3 + 131072 - num) && num5 <= num3 + 131072 + num) { int num6 = 0; int num7 = 0; long num8; long num9; if (gms_PLAYER_WORK.obj_work.move.x == 0) { if (gms_PLAYER_WORK.obj_work.move.y == 0) { return; } num8 = ( long )gms_PLAYER_WORK.obj_work.pos.x; num9 = 0L; } else if (gms_PLAYER_WORK.obj_work.move.y == 0) { num8 = 0L; num9 = ( long )gms_PLAYER_WORK.obj_work.pos.y; } else { num8 = ( long )(( long )gms_PLAYER_WORK.obj_work.move.y << 12); num8 /= ( long )gms_PLAYER_WORK.obj_work.move.x; num9 = num8 * ( long )gms_PLAYER_WORK.obj_work.pos.x; num9 >>= 12; num9 = ( long )gms_PLAYER_WORK.obj_work.pos.y - num9; } long num10 = (long)AppMain.mtMathCos((int)((ushort)gms_GMK_SEESAW_WORK.tilt)); long num11 = (long)AppMain.mtMathSin((int)((ushort)gms_GMK_SEESAW_WORK.tilt)); num11 <<= 12; num10 = num11 / num10; num11 = num10 * ( long )(obj_work.pos.x + num); num11 >>= 12; num11 = ( long )(obj_work.pos.y - num2) - num11; if (num8 != 0L && num8 == num10) { num6 = gms_PLAYER_WORK.obj_work.pos.x; num7 = ( int )((num10 * ( long )num6 >> 12) + num11); } else if (num8 != 0L && num9 != 0L) { num6 = ( int )((num11 - num9 << 12) / (num8 - num10)); num7 = ( int )((num10 * ( long )num6 >> 12) + num11); } else if (num8 == 0L) { num7 = ( int )num9; if (num10 != 0L) { num6 = ( int )((( long )num7 - num11 << 12) / num10); } else { num6 = gms_PLAYER_WORK.obj_work.pos.x; } } else if (num9 == 0L) { num6 = ( int )num8; num7 = ( int )((num10 * num8 >> 12) + num11); } if (obj_work.pos.x - (num3 - num) <= num6 && num6 <= obj_work.pos.x + (num3 + num) && obj_work.pos.y + (num4 - num2) + 2 >= num7 && num7 >= obj_work.pos.y - (num4 + num2) - 2) { int num12 = gms_PLAYER_WORK.obj_work.pos.x - gms_PLAYER_WORK.obj_work.move.x; int num13 = gms_PLAYER_WORK.obj_work.pos.y - gms_PLAYER_WORK.obj_work.move.y; int x = gms_PLAYER_WORK.obj_work.pos.x; int num14 = gms_PLAYER_WORK.obj_work.pos.y; if (num12 < x) { AppMain.MTM_MATH_SWAP <int>(ref num12, ref x); } if (num13 < num14) { AppMain.MTM_MATH_SWAP <int>(ref num13, ref num14); } num13 += 1280; num14 -= 1280; if (x <= num6 && num6 <= num12 && num13 >= num7 && num7 >= num14) { gms_GMK_SEESAW_WORK.ply_work = gms_PLAYER_WORK; gms_GMK_SEESAW_WORK.hold_x = num6 - num; gms_GMK_SEESAW_WORK.hold_y = num7; if (AppMain.control_right == null) { AppMain.gmGmkSeesaw_PlayerHold(obj_work); return; } obj_work.ppFunc = AppMain.gmGmkSeesaw_PlayerHold; } } } }
private static void gmGmkSeesaw_PlayerHold_100(AppMain.OBS_OBJECT_WORK obj_work) { AppMain.GMS_GMK_SEESAW_WORK gmsGmkSeesawWork = (AppMain.GMS_GMK_SEESAW_WORK)obj_work; AppMain.GMS_PLAYER_WORK plyWork = gmsGmkSeesawWork.ply_work; AppMain.lock_seesaw_id = (ushort)0; if (plyWork.seq_state != 44 || AppMain.control_right != gmsGmkSeesawWork || ((int)plyWork.obj_work.move_flag & 256) != 0) { gmsGmkSeesawWork.tilt_d = (short)0; gmsGmkSeesawWork.tilt_se_timer = (short)0; if (AppMain.control_right == gmsGmkSeesawWork) { AppMain.control_right = (AppMain.GMS_GMK_SEESAW_WORK)null; } obj_work.ppFunc = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmGmkSeesawStay); AppMain.gmGmkSeesawStay(obj_work); } else { AppMain.lock_seesaw_id = gmsGmkSeesawWork.seesaw_id; gmsGmkSeesawWork.tilt_timer = (short)60; AppMain.control_right = gmsGmkSeesawWork; int num1 = AppMain.GmPlayerKeyGetGimmickRotZ(gmsGmkSeesawWork.ply_work); if (num1 > 256) { num1 = 256; } if (num1 < -256) { num1 = -256; } gmsGmkSeesawWork.tilt_d = (short)num1; if (gmsGmkSeesawWork.tilt_d != (short)0) { gmsGmkSeesawWork.tilt += gmsGmkSeesawWork.tilt_d; if (gmsGmkSeesawWork.tilt_se_timer == (short)0) { AppMain.GmSoundPlaySE("Seesaw"); gmsGmkSeesawWork.tilt_se_timer = (short)8; } --gmsGmkSeesawWork.tilt_se_timer; if (gmsGmkSeesawWork.tilt >= (short)4608) { gmsGmkSeesawWork.tilt = (short)4608; gmsGmkSeesawWork.tilt_d = (short)0; } if (gmsGmkSeesawWork.tilt <= (short)-4608) { gmsGmkSeesawWork.tilt = (short)-4608; gmsGmkSeesawWork.tilt_d = (short)0; } } obj_work.dir.z = (ushort)gmsGmkSeesawWork.tilt; AppMain.seesaw_tilt[(int)gmsGmkSeesawWork.seesaw_id] = (short)obj_work.dir.z; if (((int)plyWork.obj_work.move_flag & 4) != 0) { int num2 = AppMain.mtMathSin((int)(ushort)gmsGmkSeesawWork.tilt) * 29; int num3 = obj_work.pos.x + num2; long num4 = (long)(plyWork.obj_work.pos.x - num3 << 12) / (long)AppMain.mtMathCos((int)gmsGmkSeesawWork.tilt); gmsGmkSeesawWork.player_distance = num4; if (((int)plyWork.obj_work.disp_flag & 1) == 0 && gmsGmkSeesawWork.player_speed > 0 || ((int)plyWork.obj_work.disp_flag & 1) != 0 && gmsGmkSeesawWork.player_speed < 0) { gmsGmkSeesawWork.player_speed = 0; } } long playerDistance = gmsGmkSeesawWork.player_distance; gmsGmkSeesawWork.player_distance += (long)gmsGmkSeesawWork.player_speed; long num5 = gmsGmkSeesawWork.player_distance - playerDistance; gmsGmkSeesawWork.player_speed += 256 * AppMain.mtMathSin((int)(ushort)gmsGmkSeesawWork.tilt) >> 12; int num6 = AppMain.mtMathSin((int)(ushort)gmsGmkSeesawWork.tilt) * 29; int num7 = obj_work.pos.x + num6; int num8 = AppMain.mtMathCos((int)(ushort)gmsGmkSeesawWork.tilt) * 29; int num9 = obj_work.pos.y - num8; int num10 = (int)(gmsGmkSeesawWork.player_distance * (long)AppMain.mtMathCos((int)(ushort)gmsGmkSeesawWork.tilt) >> 12); int num11 = num7 + num10; int num12 = (int)(gmsGmkSeesawWork.player_distance * (long)AppMain.mtMathSin((int)(ushort)gmsGmkSeesawWork.tilt) >> 12); int num13 = num9 + num12; if (gmsGmkSeesawWork.player_speed < 0 && ((int)plyWork.obj_work.disp_flag & 1) == 0) { plyWork.obj_work.disp_flag |= 1U; } else if (gmsGmkSeesawWork.player_speed > 0 && ((int)plyWork.obj_work.disp_flag & 1) != 0) { plyWork.obj_work.disp_flag &= 4294967294U; } if (gmsGmkSeesawWork.player_distance <= 231424L && gmsGmkSeesawWork.player_distance >= -231424L) { plyWork.obj_work.spd.x = num11 - plyWork.obj_work.pos.x; plyWork.obj_work.spd.y = num13 - plyWork.obj_work.pos.y; } else { int num2 = (int)(num5 * (long)AppMain.mtMathCos((int)(ushort)gmsGmkSeesawWork.tilt) >> 12); int spdy = (int)(num5 * (long)AppMain.mtMathSin((int)(ushort)gmsGmkSeesawWork.tilt) >> 12); if (AppMain.MTM_MATH_ABS(num2) < 256) { num2 = num2 >= 0 ? 1024 : -1024; } AppMain.GmPlySeqGmkInitSeesawEnd(plyWork, num2, spdy); gmsGmkSeesawWork.tilt_d = (short)0; AppMain.control_right = (AppMain.GMS_GMK_SEESAW_WORK)null; AppMain.lock_seesaw_id = (ushort)0; obj_work.ppFunc = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmGmkSeesawStay); } } }
private static void gmGmkSeesawStay(AppMain.OBS_OBJECT_WORK obj_work) { AppMain.GMS_GMK_SEESAW_WORK gmsGmkSeesawWork = (AppMain.GMS_GMK_SEESAW_WORK)obj_work; AppMain.GMS_PLAYER_WORK gmsPlayerWork = AppMain.g_gm_main_system.ply_work[0]; if ((int)AppMain.lock_seesaw_id == (int)gmsGmkSeesawWork.seesaw_id) { gmsGmkSeesawWork.tilt = AppMain.seesaw_tilt[(int)gmsGmkSeesawWork.seesaw_id]; obj_work.dir.z = (ushort)gmsGmkSeesawWork.tilt; gmsGmkSeesawWork.tilt_timer = (short)60; } else if ((int)gmsGmkSeesawWork.tilt != (int)gmsGmkSeesawWork.initial_tilt) { if (gmsGmkSeesawWork.tilt_timer <= (short)0) { if ((int)gmsGmkSeesawWork.tilt > (int)gmsGmkSeesawWork.initial_tilt) { gmsGmkSeesawWork.tilt -= (short)256; if ((int)gmsGmkSeesawWork.tilt < (int)gmsGmkSeesawWork.initial_tilt) { gmsGmkSeesawWork.tilt = gmsGmkSeesawWork.initial_tilt; } } else if ((int)gmsGmkSeesawWork.tilt < (int)gmsGmkSeesawWork.initial_tilt) { gmsGmkSeesawWork.tilt += (short)256; if ((int)gmsGmkSeesawWork.tilt > (int)gmsGmkSeesawWork.initial_tilt) { gmsGmkSeesawWork.tilt = gmsGmkSeesawWork.initial_tilt; } } } else { --gmsGmkSeesawWork.tilt_timer; } } obj_work.dir.z = (ushort)gmsGmkSeesawWork.tilt; if (gmsGmkSeesawWork.tilt == (short)0) { gmsGmkSeesawWork.tilt = (short)0; } if (((int)gmsPlayerWork.player_flag & 1024) != 0 || ((int)gmsPlayerWork.obj_work.flag & 2) != 0 || ((int)gmsPlayerWork.obj_work.move_flag & 16) != 0 && gmsPlayerWork.obj_work.spd.y < 0) { return; } int num1 = AppMain.mtMathSin((int)(ushort)gmsGmkSeesawWork.tilt) * 29; int num2 = AppMain.mtMathCos((int)(ushort)gmsGmkSeesawWork.tilt) * 29; int num3 = AppMain.mtMathCos((int)(ushort)gmsGmkSeesawWork.tilt) * 112 / 2; int num4 = AppMain.MTM_MATH_ABS(AppMain.mtMathSin((int)(ushort)gmsGmkSeesawWork.tilt) * 112 / 2); int num5 = gmsPlayerWork.obj_work.pos.x - obj_work.pos.x; if (num5 < -(num3 + 131072 - num1) || num5 > num3 + 131072 + num1) { return; } int num6 = 0; int num7 = 0; long num8; long num9; if (gmsPlayerWork.obj_work.move.x == 0) { if (gmsPlayerWork.obj_work.move.y == 0) { return; } num8 = (long)gmsPlayerWork.obj_work.pos.x; num9 = 0L; } else if (gmsPlayerWork.obj_work.move.y == 0) { num8 = 0L; num9 = (long)gmsPlayerWork.obj_work.pos.y; } else { num8 = (long)(gmsPlayerWork.obj_work.move.y << 12) / (long)gmsPlayerWork.obj_work.move.x; long num10 = num8 * (long)gmsPlayerWork.obj_work.pos.x >> 12; num9 = (long)gmsPlayerWork.obj_work.pos.y - num10; } long num11 = (long)AppMain.mtMathCos((int)(ushort)gmsGmkSeesawWork.tilt); long num12 = ((long)AppMain.mtMathSin((int)(ushort)gmsGmkSeesawWork.tilt) << 12) / num11; long num13 = num12 * (long)(obj_work.pos.x + num1) >> 12; long num14 = (long)(obj_work.pos.y - num2) - num13; if (num8 != 0L && num8 == num12) { num6 = gmsPlayerWork.obj_work.pos.x; num7 = (int)((num12 * (long)num6 >> 12) + num14); } else if (num8 != 0L && num9 != 0L) { num6 = (int)((num14 - num9 << 12) / (num8 - num12)); num7 = (int)((num12 * (long)num6 >> 12) + num14); } else if (num8 == 0L) { num7 = (int)num9; num6 = num12 == 0L ? gmsPlayerWork.obj_work.pos.x : (int)(((long)num7 - num14 << 12) / num12); } else if (num9 == 0L) { num6 = (int)num8; num7 = (int)((num12 * num8 >> 12) + num14); } if (obj_work.pos.x - (num3 - num1) > num6 || num6 > obj_work.pos.x + (num3 + num1) || (obj_work.pos.y + (num4 - num2) + 2 < num7 || num7 < obj_work.pos.y - (num4 + num2) - 2)) { return; } int a1 = gmsPlayerWork.obj_work.pos.x - gmsPlayerWork.obj_work.move.x; int a2 = gmsPlayerWork.obj_work.pos.y - gmsPlayerWork.obj_work.move.y; int x = gmsPlayerWork.obj_work.pos.x; int y = gmsPlayerWork.obj_work.pos.y; if (a1 < x) { AppMain.MTM_MATH_SWAP <int>(ref a1, ref x); } if (a2 < y) { AppMain.MTM_MATH_SWAP <int>(ref a2, ref y); } int num15 = a2 + 1280; int num16 = y - 1280; if (x > num6 || num6 > a1 || (num15 < num7 || num7 < num16)) { return; } gmsGmkSeesawWork.ply_work = gmsPlayerWork; gmsGmkSeesawWork.hold_x = num6 - num1; gmsGmkSeesawWork.hold_y = num7; if (AppMain.control_right == null) { AppMain.gmGmkSeesaw_PlayerHold(obj_work); } else { obj_work.ppFunc = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmGmkSeesaw_PlayerHold); } }