private static void gmBoss1EffScatterSetFlyParam( AppMain.GMS_BOSS1_EFF_SCT_PART_NDC_WORK sct_part_ndc) { AppMain.OBS_OBJECT_WORK obsObjectWork = AppMain.GMM_BS_OBJ((object)sct_part_ndc); int num1 = (int)AppMain.mtMathRand() % 180; int ang = AppMain.AKM_DEGtoA32(num1 + (num1 > 90 ? 45 : -45)); float num2 = !sct_part_ndc.is_ironball ? 5f : 3f; obsObjectWork.spd.y = (int)(4096.0 * (double)num2 * (double)AppMain.nnSin(ang)); obsObjectWork.spd.x = (int)(4096.0 * (double)num2 * (double)AppMain.nnCos(ang)); obsObjectWork.move_flag |= 128U; }
private static void gmBoss1EffScatterInit(AppMain.GMS_BOSS1_CHAIN_WORK chain_work) { for (int index = 0; index < 9; ++index) { AppMain.GMS_BS_CMN_NODE_CTRL_OBJECT controlObjectBySize = AppMain.GmBsCmnCreateNodeControlObjectBySize(AppMain.GMM_BS_OBJ((object)chain_work), chain_work.cnm_mgr_work, chain_work.sct_cnm_reg_ids[index], chain_work.snm_work, chain_work.sct_snm_reg_ids[index], (AppMain.TaskWorkFactoryDelegate)(() => (object)new AppMain.GMS_BOSS1_EFF_SCT_PART_NDC_WORK())); AppMain.GMS_BOSS1_EFF_SCT_PART_NDC_WORK sct_part_ndc = (AppMain.GMS_BOSS1_EFF_SCT_PART_NDC_WORK)controlObjectBySize; controlObjectBySize.user_timer = (uint)AppMain.mtMathRand() % 20U; controlObjectBySize.is_enable = 0; AppMain.gmBoss1EffScatterSetPartParam(sct_part_ndc, index == 8); AppMain.GMM_BS_OBJ((object)controlObjectBySize).move_flag |= 4608U; AppMain.nnMakeUnitQuaternion(ref controlObjectBySize.user_quat); controlObjectBySize.proc_update = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmBoss1EffScatterProcWait); } }
private static void gmBoss1EffScatterProcFly(AppMain.OBS_OBJECT_WORK obj_work) { AppMain.GMS_BS_CMN_NODE_CTRL_OBJECT ndc_obj = (AppMain.GMS_BS_CMN_NODE_CTRL_OBJECT)obj_work; AppMain.GMS_BOSS1_EFF_SCT_PART_NDC_WORK effSctPartNdcWork = (AppMain.GMS_BOSS1_EFF_SCT_PART_NDC_WORK)ndc_obj; AppMain.nnMultiplyQuaternion(ref ndc_obj.user_quat, ref effSctPartNdcWork.spin_quat, ref ndc_obj.user_quat); AppMain.GmBsCmnSetWorldMtxFromNCObjectPosture(ndc_obj); if (ndc_obj.user_timer != 0U) { --ndc_obj.user_timer; } else { obj_work.flag |= 4U; } }
private static void gmBoss1EffScatterProcWait(AppMain.OBS_OBJECT_WORK obj_work) { AppMain.GMS_BS_CMN_NODE_CTRL_OBJECT ndc_obj = (AppMain.GMS_BS_CMN_NODE_CTRL_OBJECT)obj_work; AppMain.GMS_BOSS1_EFF_SCT_PART_NDC_WORK sct_part_ndc = (AppMain.GMS_BOSS1_EFF_SCT_PART_NDC_WORK)ndc_obj; if (ndc_obj.user_timer != 0U) { --ndc_obj.user_timer; } else { AppMain.GmBsCmnAttachNCObjectToSNMNode(ndc_obj); AppMain.gmBoss1EffScatterSetFlyParam(sct_part_ndc); ndc_obj.is_enable = 1; ndc_obj.user_timer = 180U; ndc_obj.proc_update = new AppMain.MPP_VOID_OBS_OBJECT_WORK(AppMain.gmBoss1EffScatterProcFly); } }
private static void gmBoss1EffScatterSetPartParam( AppMain.GMS_BOSS1_EFF_SCT_PART_NDC_WORK sct_part_ndc, bool is_ironball) { AppMain.GMS_BS_CMN_NODE_CTRL_OBJECT cmnNodeCtrlObject = (AppMain.GMS_BS_CMN_NODE_CTRL_OBJECT)sct_part_ndc; int ang; if (is_ironball) { sct_part_ndc.is_ironball = true; cmnNodeCtrlObject.user_ofst.y = 32f; ang = AppMain.GMD_BOSS1_EFF_SCT_PART_IBALL_SPIN_SPD_DEG; } else { sct_part_ndc.is_ironball = false; cmnNodeCtrlObject.user_ofst.y = 8f; ang = AppMain.GMD_BOSS1_EFF_SCT_PART_RING_SPIN_SPD_DEG; } AppMain.nnMakeUnitQuaternion(ref sct_part_ndc.spin_quat); for (int index = 0; index < 2; ++index) { AppMain.NNS_VECTOR dst_vec = new AppMain.NNS_VECTOR(); AppMain.NNS_QUATERNION dst = new AppMain.NNS_QUATERNION(); float rand_z = AppMain.MTM_MATH_CLIP((float)((double)AppMain.FX_FX32_TO_F32(AppMain.AkMathRandFx()) * 2.0 - 1.0), -1f, 1f); short rand_angle = AppMain.AKM_DEGtoA16(360f * AppMain.FX_FX32_TO_F32(AppMain.AkMathRandFx())); AppMain.AkMathGetRandomUnitVector(dst_vec, rand_z, rand_angle); AppMain.nnMakeRotateAxisQuaternion(out dst, dst_vec.x, dst_vec.y, dst_vec.z, ang); AppMain.nnMultiplyQuaternion(ref sct_part_ndc.spin_quat, ref dst, ref sct_part_ndc.spin_quat); //AppMain.GlobalPool<AppMain.NNS_VECTOR>.Release(dst_vec); } if (is_ironball) { AppMain.ObjObjectFieldRectSet(AppMain.GMM_BS_OBJ((object)cmnNodeCtrlObject), (short)-24, (short)-24, (short)24, (short)24); } else { AppMain.ObjObjectFieldRectSet(AppMain.GMM_BS_OBJ((object)cmnNodeCtrlObject), (short)-8, (short)-8, (short)8, (short)8); } }