MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / SpewEverything

Method SpewEverything

scripts/AIGame.cpp:1808–1839  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1806}
1807
1808void SuperThief::SpewEverything(int me) {
1809 int i;
1810 int powerup_handle;
1811 int room;
1812 vector pos;
1813
1814 Obj_Value(me, VF_GET, OBJV_I_ROOMNUM, &room);
1815 Obj_Value(me, VF_GET, OBJV_V_POS, &pos);
1816
1817 for (i = 0; i < memory->num_stolen_weapons; i++) {
1818 uint16_t id;
1819 int j;
1820
1821 for (j = 0; j < memory->stolen_weapons[i].amount; j++) {
1822 float speed = rand() / (float)RAND_MAX * 20.0f + 5.0f;
1823 vector dir;
1824
1825 dir.x = rand() / (float)RAND_MAX - 0.5f;
1826 dir.y = rand() / (float)RAND_MAX - 0.5f;
1827 dir.z = rand() / (float)RAND_MAX - 0.5f;
1828
1829 vm_VectorNormalize(&dir);
1830 dir *= speed;
1831
1832 Player_Value(memory->stolen_weapons[i].owner, VF_GET, PLYSV_US_WEAPON_POWERUP_ID, &id,
1833 memory->stolen_weapons[i].index);
1834 powerup_handle = Obj_Create(OBJ_POWERUP, id, room, &pos, NULL, OBJECT_HANDLE_NONE, &dir);
1835 }
1836
1837 memory->stolen_weapons[i].amount = 0;
1838 }
1839}
1840
1841bool SuperThief::DoNotify(int me, tOSIRISEVTAINOTIFY *notify) {
1842 if (notify->notify_type == AIN_MELEE_HIT) {

Callers

nothing calls this directly

Calls 4

Obj_ValueFunction · 0.85
Player_ValueFunction · 0.85
Obj_CreateFunction · 0.85
vm_VectorNormalizeFunction · 0.70

Tested by

no test coverage detected