summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Noga <Tempus@Spectrum-Song.local>2011-10-13 02:26:29 -0500
committerColin Noga <Tempus@Spectrum-Song.local>2011-10-13 02:26:29 -0500
commit4d2eae84e71f7f8f068377335dca518cf4ba3850 (patch)
tree40ee0f057948fe9e674fbcd2a50bdd7141672747
parent5086f4d34bd7a39ec7ea3377312dc97e11eadb31 (diff)
parentb3c762b06e3238208ba54651545ca51b23e008c9 (diff)
downloadkamek-4d2eae84e71f7f8f068377335dca518cf4ba3850.tar.gz
kamek-4d2eae84e71f7f8f068377335dca518cf4ba3850.zip
Merge branch 'level-select' of ssh://treeki.shacknet.nu:30000/Kamek into level-select
-rw-r--r--src/effects.cpp69
-rw-r--r--src/effects.h5
2 files changed, 56 insertions, 18 deletions
diff --git a/src/effects.cpp b/src/effects.cpp
index 68294a1..40f08a2 100644
--- a/src/effects.cpp
+++ b/src/effects.cpp
@@ -1,7 +1,7 @@
#include "effects.h"
const char* effects_name_list [] = {
- "Wm_mr_2dlandsmoke",
+ "Wm_mr_2dlandsmoke", // 0000
"Wm_mr_cmnsndlandsmk",
"Wm_mr_cmnlandsmoke",
"Wm_en_landsmoke",
@@ -11,7 +11,7 @@ const char* effects_name_list [] = {
"Wm_en_burst_big",
"Wm_en_burst_m",
"Wm_en_burst_s",
- "Wm_en_burst_ss",
+ "Wm_en_burst_ss", // 0010
"Wm_en_burst_water01",
"Wm_en_burst_water02",
"Wm_en_cmnwatertail",
@@ -21,7 +21,7 @@ const char* effects_name_list [] = {
"Wm_en_waterwave_in",
"Wm_en_waterwave_in_a",
"Wm_en_waterwave_in_b",
- "Wm_en_firevanish",
+ "Wm_en_firevanish", // 0020
"Wm_en_watersplash",
"Wm_en_watersplash_cld",
"Wm_mr_watersplash",
@@ -31,7 +31,7 @@ const char* effects_name_list [] = {
"Wm_en_poisonwave_a",
"Wm_en_poisonwave_b",
"Wm_en_cmnmagmawave",
- "Wm_en_magmawave",
+ "Wm_en_magmawave", // 0030
"Wm_en_magmawave_a",
"Wm_en_magmawave_b",
"Wm_en_vshit",
@@ -41,7 +41,7 @@ const char* effects_name_list [] = {
"Wm_en_vshit_ring",
"Wm_en_comattack",
"Wm_ob_cmnshotstar",
- "Wm_ob_cmnshothit",
+ "Wm_ob_cmnshothit", // 0040
"Wm_ob_cmnshotspark",
"Wm_ob_cmnsparkloop",
"Wm_ob_cmnspark",
@@ -51,7 +51,7 @@ const char* effects_name_list [] = {
"Wm_ob_cmnboxsmoke",
"Wm_ob_cmnboxgrain",
"Wm_en_hit",
- "Wm_en_hit_ring",
+ "Wm_en_hit_ring", // 0050
"Wm_mr_misshit",
"Wm_mr_misshit_ring",
"Wm_en_quicksand",
@@ -61,7 +61,7 @@ const char* effects_name_list [] = {
"Wm_mr_landsmoke",
"Wm_mr_landsmoke_s",
"Wm_mr_landsmoke_ss",
- "Wm_mr_sealandsmk",
+ "Wm_mr_sealandsmk", // 0060
"Wm_mr_sealandsmk_s",
"Wm_mr_sealandsmk_ss",
"Wm_mr_sndlandsmk",
@@ -71,7 +71,7 @@ const char* effects_name_list [] = {
"Wm_mr_beachlandsmk_s",
"Wm_mr_beachlandsmk_ss",
"Wm_mr_slipsmoke",
- "Wm_mr_slipsmoke_ss",
+ "Wm_mr_slipsmoke_ss", // 0070
"Wm_mr_slipsmoke_big",
"Wm_mr_sndslipsmk",
"Wm_mr_sndslipsmk_ss",
@@ -81,7 +81,7 @@ const char* effects_name_list [] = {
"Wm_mr_iceslipsmk_ss",
"Wm_mr_brakesmoke",
"Wm_mr_brakesmoke_ss",
- "Wm_mr_sndbrakesmk",
+ "Wm_mr_sndbrakesmk", // 0080
"Wm_mr_sndbrakesmk_ss",
"Wm_mr_beachbrakesmk",
"Wm_mr_beachbrakesmk_ss",
@@ -91,7 +91,7 @@ const char* effects_name_list [] = {
"Wm_mr_quicksand",
"Wm_mr_swimpaddle",
"Wm_mr_flutterkick",
- "Wm_mr_ivy",
+ "Wm_mr_ivy", // 0090
"Wm_en_firebar_fire",
"Wm_en_firebar_ind",
"Wm_en_firebar",
@@ -101,7 +101,7 @@ const char* effects_name_list [] = {
"Wm_mr_iceball_a",
"Wm_mr_iceball_b",
"Wm_mr_iceball",
- "Wm_ob_icemisshit",
+ "Wm_ob_icemisshit", // 0100
"Wm_ob_icemisshit_smk",
"Wm_mr_fireball_hit",
"Wm_mr_fireball_hit01",
@@ -112,7 +112,7 @@ const char* effects_name_list [] = {
"Wm_mr_movecliff",
"Wm_mr_cliffcatch",
"Wm_mr_cliffcatch_cd",
- "Wm_en_iron",
+ "Wm_en_iron", // 0110
"Wm_mr_wallkick_r",
"Wm_mr_wallkick_up_r",
"Wm_mr_wallkick_cld_r",
@@ -122,7 +122,7 @@ const char* effects_name_list [] = {
"Wm_mr_wallkick_l",
"Wm_mr_wallkick_up_l",
"Wm_mr_wallkick_cld_l",
- "Wm_mr_wallkick_dn_l",
+ "Wm_mr_wallkick_dn_l", // 0120
"Wm_mr_wallkick_c_l",
"Wm_mr_wallkick_b_l",
"Wm_mr_wallkick_s_r",
@@ -132,7 +132,7 @@ const char* effects_name_list [] = {
"Wm_mr_wallkick_c_s_r",
"Wm_mr_wallkick_b_s_r",
"Wm_mr_wallkick_s_l",
- "Wm_mr_wallkick_up_s_l",
+ "Wm_mr_wallkick_up_s_l", // 0130
"Wm_mr_wallkick_cld_s_l",
"Wm_mr_wallkick_dn_s_l",
"Wm_mr_wallkick_c_s_l",
@@ -1004,17 +1004,50 @@ const char* effects_name_list [] = {
"Wm_ob_treasureboxwait_b"
};
-extern "C" void SpawnEffect(const char*, int, Vec*, int, int);
+extern "C" bool SpawnEffect(const char*, int, Vec*, S16Vec*, Vec*);
// Just call CreateEffect(this, number_between_0_and_1000);
bool CreateEffect(dEn_c* enemy, int effect_num) {
if (effect_num > 1000)
return false;
- if (effect_num < 1000)
+ if (effect_num < 0)
return false;
Vec tempVec = (Vec){ enemy->pos.x, enemy->pos.y, 5500.0 };
const char* effect_name = effects_name_list[effect_num];
- SpawnEffect(effect_name, 0, &tempVec, 0, 0);
- return true;
+ return SpawnEffect(effect_name, 0, &tempVec, 0, 0);
+}
+
+bool CreateEffect(Vec* pos, S16Vec* rot, Vec* scale, int effect_num) {
+ if (effect_num > 1000)
+ return false;
+ if (effect_num < 0)
+ return false;
+ Vec tempVec = (Vec){ pos->x, pos->y, 5500.0 };
+ const char* effect_name = effects_name_list[effect_num];
+ return SpawnEffect(effect_name, 0, &tempVec, rot, scale);
+}
+
+bool CreateEffect(const char* name, Vec* pos) {
+ //check effects name list
+ bool exists = false;
+ for( int ii = 0; ii < sizeof(effects_name_list); ii++) {
+ if (memcmp(name, effects_name_list[ii], strlen(effects_name_list[ii]) ) ) {
+ exists = true;
+ break;
+ }
+ }
+ if (!exists)
+ return false;
+ return SpawnEffect(name, 0, pos, 0, 0);
+}
+
+/*
+void* CustomEffectSpawn(const char* name) {
+ // FILL ME IN
+
+ //EGG::Effect* effect = new EGG::Effect();
+
+ // SKIP THE DTOR
}
+*/
diff --git a/src/effects.h b/src/effects.h
index f3dad62..ea4ba2a 100644
--- a/src/effects.h
+++ b/src/effects.h
@@ -5,5 +5,10 @@
#include <game.h>
bool CreateEffect(dEn_c* enemy, int effect_num);
+bool CreateEffect(Vec* pos, S16Vec* rot, Vec* scale, int effect_num);
+bool CreateEffect(const char* name, Vec* pos);
+
+// Actually will return an EGG::Effect instance
+//void* CustomEffectSpawn(const char* name);
#endif