Cheese Wow Cheese is so helpful!
  
   Joined: Mar 18 2007 Posts: 1017 Offline
  | 
		
			
			  
			    
				
					 Posted: Fri Dec 19, 2008 12:02 am     Post subject: ASSS in a nutshell | 
					  | 
					      | 
				 
			     
			   | 
			 
			
				
  | 
			 
			
					
 
/*
 
//ships
 
SHIP_WARBIRD = 0,
 
SHIP_JAVELIN,
 
SHIP_SPIDER,
 
SHIP_LEVIATHAN,
 
SHIP_TERRIER,
 
SHIP_WEASEL,
 
SHIP_LANCASTER,
 
SHIP_SHARK,
 
SHIP_SPEC
 
 
//sounds
 
SOUND_NONE = 0,
 
SOUND_BEEP1,
 
SOUND_BEEP2,
 
SOUND_NOTATT,
 
SOUND_VIOLENT,
 
SOUND_HALLELLULA,
 
SOUND_REAGAN,
 
SOUND_INCONCEIVABLE,
 
SOUND_CHURCHILL,
 
SOUND_LISTEN,
 
SOUND_CRYING,
 
SOUND_BURP,
 
SOUND_GIRL,
 
SOUND_SCREAM,
 
SOUND_FART1,
 
SOUND_FART2,
 
SOUND_PHONE,
 
SOUND_WORLDATTACK,
 
SOUND_GIBBERISH,
 
SOUND_OOO,
 
SOUND_GEE,
 
SOUND_OHH,
 
SOUND_AWW,
 
SOUND_GAMESUCKS,
 
SOUND_SHEEP,
 
SOUND_CANTLOGIN,
 
SOUND_BEEP3,
 
SOUND_MUSICLOOP = 100,
 
SOUND_MUSICSTOP,
 
SOUND_MUSICONCE,
 
SOUND_DING,
 
SOUND_GOAL
 
 
game->GivePrize(&t, 21, 5); //give Player p 5 repels (prize #21)
 
//prizes
 
PRIZE_RECHARGE = 1,
 
PRIZE_ENERGY,
 
PRIZE_ROTATION,
 
PRIZE_STEALTH,
 
PRIZE_CLOAK,
 
PRIZE_XRADAR,
 
PRIZE_WARP,
 
PRIZE_GUN,
 
PRIZE_BOMB,
 
PRIZE_BOUNCE,
 
PRIZE_THRUST,
 
PRIZE_SPEED,
 
PRIZE_FULLCHARGE,
 
PRIZE_SHUTDOWN,
 
PRIZE_MULTIFIRE,
 
PRIZE_PROX,
 
PRIZE_SUPER,
 
PRIZE_SHIELD,
 
PRIZE_SHRAP,
 
PRIZE_ANTIWARP,
 
PRIZE_REPEL,
 
PRIZE_BURST,
 
PRIZE_DECOY,
 
PRIZE_THOR,
 
PRIZE_MULTIPRIZE,
 
PRIZE_BRICK,
 
PRIZE_ROCKET,
 
PRIZE_PORTAL
 
        
 
//this struct/union thing can be used to refer to a set of players   
 
typedef struct
 
{
 
//which type of target is this? 
 
   enum
 
   {
 
      T_NONE,   //< refers to no players 
 
      T_PLAYER, //< refers to one single player (u.p must be filled in)
 
      T_ARENA,  //< refers to a whole arena (u.arena must be filled in)
 
      T_FREQ,   //< refers to one freq (u.freq must be filled in)
 
      T_ZONE,   //< refers to the whole zone
 
      T_LIST    //< refers to an arbitrary set of players (u.list)
 
   } type;
 
//the union that contains the actual data
 
   union
 
   {
 
      Player *p;        //< the player, if type == T_PLAYER
 
      Arena *arena;     //< the arena, if type == T_ARENA
 
      struct { Arena *arena; int freq; } freq;
 
                          //< the arena and freq, if type == T_FREQ
 
      LinkedList list;  //< a list of players, if type == T_LIST
 
   } u;
 
} Target;
 
 
Target t;
 
t.type = T_PLAYER;
 
t.u.p = p;
 
 
 
//chat
 
chat->SendMessage(p,"This is a message");
 
chat->SendMessage(p,"This is a message that displays an int. %i",someInt);
 
chat->SendMessage(p,"This is a message that displays a char array. %s",charArray);
 
chat->SendArenaMessage(arena,"This is an arena-wide message");
 
chat->SendArenaMessage(arena,"This is an arena-wide message that displays an int. %i",someInt);
 
chat->SendArenaMessage(arena,"This is an arena-wide message that displays a char array. %s",charArray);
 
SendMessage //Send a green arena message to a player.
 
SendCmdMessage //Sends a command response to a player.
 
SendSetMessage //Sends a green arena message to a set of players.
 
SendSoundMessage //Sends a green arena message plus sound code to a player.
 
SendSetSoundMessage //Sends a green arena message plus sound code to a set of players.
 
SendAnyMessage //Sends an arbitrary chat message to a set of players.
 
SendArenaMessage //Sends a green arena message to all players in an arena. Use ALLARENAS for areana to send to all players in all arenas.
 
SendArenaSoundMessage //Sends a green arena message plus sound code to all players in an arena.
 
SendModMessage //Sends a moderator chat message to all connected staff.
 
SendRemotePrivMessage //Sends a remove private message to a set of players.
 
chat->SendMessage(Player *p, const char *format, ...)
 
chat->SendCmdMessage(Player *p, const char *format, ...)
 
chat->SendSetMessage(LinkedList *set, const char *format, ...)
 
chat->SendSoundMessage(Player *p, char sound, const char *format, ...)
 
chat->SendSetSoundMessage(LinkedList *set, char sound, const char *format, ...)
 
chat->SendAnyMessage(LinkedList *set, char type, char sound, Player *from, const char *format, ...)
 
chat->SendArenaMessage(Arena *arena, const char *format, ...)
 
chat->SendArenaSoundMessage(Arena *arena, char sound, const char *format, ...)
 
chat->SendModMessage(const char *format, ...)
 
chat->SendRemotePrivMessage(LinkedList *set, int sound, const char *squad, const char *sender, const char *msg);
 
chat->SetArenaChatMask(Arena *arena, chat_mask_t mask);
 
chat->GetPlayerChatMask(Player *p);
 
chat->SetPlayerChatMask(Player *p, chat_mask_t mask, int timeout);
 
chat->SendWrappedText(Player *p, const char *text);
 
 
 
//log
 
L_DRIVEL is for meaningless log entries. Things that no sysop will ever care about. Use this level for printing out statements to help in debugging.
 
L_INFO is for things that people might care about.
 
L_MALICIOUS is for events that shouldn't happen unless someone is trying to hack/cheat. This is sent to online sysops as soon as it is logged (under default settings).
 
L_WARN is for things that probably shouldn't happen, but don't make a big difference.
 
L_ERROR is for events that are really bad. It is sent to online sysops as soon as it is logged (under default settings).
 
//LogP is the most commonly used logging function. It should be used when you have access to a player pointer and the event relates to that player's actions.
 
//LogA is attached to an arena rather than a player. This should be used whenever an event happens inside an arena but is tied to no specific player.
 
//Log is attached to neither an arena nor a player.
 
lm->LogP(L_DRIVEL, "my_module_name", p, "A log message attached to Player *p");
 
lm->LogA(L_DRIVEL, "my_module_name", arena, "A log message attached to Arena *arena");
 
lm->Log(L_DRIVEL, "<my_module_name> A log message");
 
 
 
//cmd   
 
cmd->AddCommand("brickwrite",Cbrickwrite, ALLARENAS, NULL); //cmd,funct,manual
 
AddCommand
 
RemoveCommand
 
 
 
//cfg
 
cfg->OpenConfigFile(NULL,"this.conf",NULL,NULL);
 
 
 
//game
 
game->SetFreq(Player *p, int freq);
 
game->SetShip(Player *p, int ship);
 
game->SetFreqAndShip(Player *p, int ship, int freq);
 
game->WarpTo(const Target *target, int x, int y);
 
game->GivePrize(const Target *target, int type, int count);
 
game->Lock(const Target *t, int notify, int spec, int timeout);
 
game->Unlock(const Target *t, int notify);
 
game->LockArena(Arena *a, int notify, int onlyarenastate, int initial, int spec);
 
game->UnlockArena(Arena *a, int notify, int onlyarenastate);
 
game->FakePosition(Player *p, struct C2SPosition *pos, int len);
 
game->FakeKill(Player *killer, Player *killed, int pts, int flags);
 
game->GetIgnoreWeapons(Player *p);
 
game->SetIgnoreWeapons(Player *p, double proportion);
 
game->ShipReset(const Target *target);
 
game->IncrementWeaponPacketCount(Player *p, int packets);
 
game->SetPlayerEnergyViewing(Player *p, int value);
 
game->SetSpectatorEnergyViewing(Player *p, int value);
 
game->ResetPlayerEnergyViewing(Player *p);
 
game->ResetSpectatorEnergyViewing(Player *p);
 
 
game->WarpTo(p, 512, 512);
 
game->SetFreq(p, freq); //Player *p, int freq (typically in the range 0-9999)
 
 
 
//lvz object
 
obj->SendState(Player *p);
 
obj->Toggle(const Target *t, int id, int on);
 
obj->ToggleSet(const Target *t, short *id, char *ons, int size);
 
obj->Move(const Target *t, int id, int x, int y, int rx, int ry);
 
obj->Image(const Target *t, int id, int image);
 
obj->Layer(const Target *t, int id, int layer);
 
obj->Timer(const Target *t, int id, int time);
 
obj->Mode(const Target *t, int id, int mode);
 
 
 
//mm
 
mm->UnloadModule(const char *name);
 
mm->EnumModules(void (*func(const char *name, const char *info,void *clos), void *clos, Arena *attachedfilter);
 
mm->AttachModule(const char *modname, Arena *arena);
 
mm->DetachModule(const char *modname, Arena *arena);
 
mm->RegInterface(void *iface, Arena *arena);
 
mm->UnregInterface(void *iface, Arena *arena);
 
mm->GetInterface(const char *id, Arena *arena);
 
mm->GetInterfaceByName(const char *name);
 
mm->ReleaseInterface(void *iface);
 
mm->RegCallback(const char *id, void *func, Arena *arena);
 
mm->UnregCallback(const char *id, void *func, Arena *arena);
 
mm->LookupCallback(const char *id, Arena *arena, LinkedList *res);
 
mm->FreeLookupResult(LinkedList *res);
 
mm->RegModuleLoader(const char *signature, ModuleLoaderFunc func);
 
mm->UnregModuleLoader(const char *signature, ModuleLoaderFunc func);
 
mm->GetModuleInfo(const char *modname);
 
mm->GetModuleLoader(const char *modname);
 
mm->DetachAllFromArena(Arena *arena);
 
*/
 
  |   
 
 
ill just leave this here... _________________ SSC Distension Owner
 
SSCU Trench Wars Developer
  Last edited by Cheese on Fri Dec 19, 2008 7:11 pm, edited 1 time in total | 
			 
		  |