+void target_init_use(entity this, entity actor, entity trigger)
+{
+ if (!(this.spawnflags & 1))
+ {
+ SetResource(actor, RES_ARMOR, start_armorvalue);
+ actor.pauserotarmor_finished = time + autocvar_g_balance_pause_armor_rot;
+ }
+
+ if (!(this.spawnflags & 2))
+ {
+ SetResource(actor, RES_HEALTH, start_health);
+ actor.pauserothealth_finished = time + autocvar_g_balance_pause_health_rot;
+ actor.pauseregen_finished = time + autocvar_g_balance_pause_health_regen;
+ }
+
+ if (!(this.spawnflags & 4))
+ {
+ SetResource(actor, RES_SHELLS, start_ammo_shells);
+ SetResource(actor, RES_BULLETS, start_ammo_nails);
+ SetResource(actor, RES_ROCKETS, start_ammo_rockets);
+ SetResource(actor, RES_CELLS, start_ammo_cells);
+ SetResource(actor, RES_PLASMA, start_ammo_plasma);
+ SetResource(actor, RES_FUEL, start_ammo_fuel);
+
+ STAT(WEAPONS, actor) = start_weapons;
+ if (this.spawnflags & 32)
+ {
+ // TODO
+ }
+ }
+
+ if (!(this.spawnflags & 8))
+ {
+ actor.strength_finished = 0;
+ actor.invincible_finished = 0;
+ if(STAT(BUFFS, actor)) // TODO: make a dropbuffs function to handle this
+ {
+ int buffid = buff_FirstFromFlags(STAT(BUFFS, actor)).m_id;
+ Send_Notification(NOTIF_ONE, actor, MSG_MULTI, ITEM_BUFF_DROP, buffid);
+ sound(actor, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM);
+ if(!IS_INDEPENDENT_PLAYER(actor))
+ Send_Notification(NOTIF_ALL_EXCEPT, actor, MSG_INFO, INFO_ITEM_BUFF_LOST, actor.netname, buffid);
+ STAT(BUFFS, actor) = 0;
+ STAT(BUFF_TIME, actor) = 0;
+ }
+ }
+
+ if (!(this.spawnflags & 16))
+ {
+ // We don't have holdables.
+ }
+
+ SUB_UseTargets(this, actor, trigger);
+}
+