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