}
}
+void GenericCommand_dumpitems(float request)
+{
+ switch(request)
+ {
+ case CMD_REQUEST_COMMAND:
+ {
+ Dump_Items();
+ return;
+ }
+
+ default:
+ case CMD_REQUEST_USAGE:
+ {
+ printf("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
+ return;
+ }
+ }
+}
+
void GenericCommand_dumpnotifs(float request)
{
switch(request)
#define GENERIC_COMMANDS(request,arguments,command) \
GENERIC_COMMAND("addtolist", GenericCommand_addtolist(request, arguments), "Add a string to a cvar") \
GENERIC_COMMAND("dumpcommands", GenericCommand_dumpcommands(request), "Dump all commands on the program to *_cmd_dump.txt") \
+ GENERIC_COMMAND("dumpitems", GenericCommand_dumpitems(request), "Dump all items to the console") \
GENERIC_COMMAND("dumpnotifs", GenericCommand_dumpnotifs(request), "Dump all notifications into notifications_dump.txt") \
GENERIC_COMMAND("dumpweapons", GenericCommand_dumpweapons(request), "Dump all weapons into weapons_dump.txt") \
GENERIC_COMMAND("maplist", GenericCommand_maplist(request, arguments), "Automatic control of maplist") \
#include "all.inc"
-void ItemTest()
+void Dump_Items()
{
- ITEMS_FOREACH(it != NULL, LAMBDA({
- print(strcat(etos(it), "\n"));
+ ITEMS_FOREACH(true, LAMBDA({
ITEM_HANDLE(Show, it);
}));
}
#ifndef BUFF_H
#define BUFF_H
-#include "../item.qh"
-CLASS(Buff, GameItem)
- METHOD(Buff, show, void(entity this))
- void Buff_show(entity this) { print("%s\n", "Buff"); }
+#include "pickup.qh"
+CLASS(Buff, Pickup)
+ ATTRIB(Buff, m_name, string, "Buff")
ENDCLASS(Buff)
#endif
ATTRIB(Pickup, m_sound, string, "misc/itempickup.wav")
ATTRIB(Pickup, m_name, string, string_null)
METHOD(Pickup, show, void(entity this))
- void Pickup_show(entity this) { printf("%s\n", this.m_name); }
+ void Pickup_show(entity this) { printf("%s: %s\n", etos(this), this.m_name); }
#ifdef SVQC
ATTRIB(Pickup, m_botvalue, int, 0)
ATTRIB(Pickup, m_itemflags, int, 0)