00001 #include "ShrinkRayPowerup.h"
00002
00003 #include "Player.h"
00004 #include "libwiigui/gui.h"
00005
00006 extern Player *g_players;
00007
00008 #define SHRINK_RAY_SCALE 2.8
00009
00010 PowerupId ShrinkRayPowerup::powerupId;
00011 Powerup *ShrinkRayPowerup::instance = new ShrinkRayPowerup();
00012
00013 GuiImageData *ShrinkRayPowerup::imageData =
00014 new GuiImageData(powerup_shrinkray_png);
00015
00016 GuiSound *ShrinkRayPowerup::sound =
00017 new GuiSound(powerup_shrinkray_pcm, powerup_shrinkray_pcm_size, SOUND_PCM);
00018
00019 string ShrinkRayPowerup::helpText[2] =
00020 {"Shrink Ray", "Shrinks the target player's playfield. "
00021 "Use this on people who have poor vision."};
00022
00023 void ShrinkRayPowerup::StartEffect(u8 player)
00024 {
00025 g_players[player].gameData.powerupData.playfieldScale = SHRINK_RAY_SCALE;
00026 }
00027
00028
00029
00030
00031
00032
00033
00034 void ShrinkRayPowerup::StopEffect(u8 player)
00035 {
00036 for (int i = 0; i < MAX_POWERUP_EFFECTS; ++i)
00037 {
00038 Powerup *powerup = g_players[player].gameData.powerupEffects[i];
00039 if (powerup && powerup->GetPowerupId() == powerupId)
00040 {
00041 return;
00042 }
00043 }
00044
00045 g_players[player].gameData.powerupData.playfieldScale = 0;
00046 }