Skip to content

Commit

Permalink
ai: make baddies drop ammo if Lara has guns
Browse files Browse the repository at this point in the history
Resolves #1000
  • Loading branch information
rr- committed Sep 22, 2023
1 parent 1b062c0 commit 06f328b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [Unreleased](https://github.com/rr-/Tomb1Main/compare/stable...develop) - ××××-××-××
- added Linux builds and toolchain
- added an option to allow Lara to roll while underwater, similar to TR2+ (#993)
- fixed baddies dropping duplicate guns (only affects mods) (#1000)

## [2.16](https://github.com/rr-/Tomb1Main/compare/2.15.3...2.16) - 2023-09-20
- added a new rendering mode called "framebuffer" that lets the game to run at lower resolutions (#114)
Expand Down
7 changes: 6 additions & 1 deletion src/game/objects/creatures/baldy.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "game/objects/creatures/baldy.h"

#include "game/creature.h"
#include "game/inventory.h"
#include "game/items.h"
#include "game/lot.h"
#include "global/const.h"
Expand Down Expand Up @@ -76,7 +77,11 @@ void Baldy_Control(int16_t item_num)
if (item->current_anim_state != BALDY_DEATH) {
item->current_anim_state = BALDY_DEATH;
Item_SwitchToAnim(item, BALDY_DIE_ANIM, -1);
Item_Spawn(item, O_SHOTGUN_ITEM);
if (Inv_RequestItem(O_SHOTGUN_ITEM)) {
Item_Spawn(item, O_SG_AMMO_ITEM);
} else {
Item_Spawn(item, O_SHOTGUN_ITEM);
}
}
} else {
AI_INFO info;
Expand Down
7 changes: 6 additions & 1 deletion src/game/objects/creatures/cowboy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "game/creature.h"
#include "game/effects.h"
#include "game/effects/gunshot.h"
#include "game/inventory.h"
#include "game/items.h"
#include "game/lot.h"
#include "global/const.h"
Expand Down Expand Up @@ -73,7 +74,11 @@ void Cowboy_Control(int16_t item_num)
if (item->current_anim_state != COWBOY_DEATH) {
item->current_anim_state = COWBOY_DEATH;
Item_SwitchToAnim(item, COWBOY_DIE_ANIM, -1);
Item_Spawn(item, O_MAGNUM_ITEM);
if (Inv_RequestItem(O_MAGNUM_ITEM)) {
Item_Spawn(item, O_MAG_AMMO_ITEM);
} else {
Item_Spawn(item, O_MAGNUM_ITEM);
}
}
} else {
AI_INFO info;
Expand Down
7 changes: 6 additions & 1 deletion src/game/objects/creatures/pierre.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "config.h"
#include "game/creature.h"
#include "game/inventory.h"
#include "game/items.h"
#include "game/los.h"
#include "game/lot.h"
Expand Down Expand Up @@ -113,7 +114,11 @@ void Pierre_Control(int16_t item_num)
if (item->current_anim_state != PIERRE_DEATH) {
item->current_anim_state = PIERRE_DEATH;
Item_SwitchToAnim(item, PIERRE_DIE_ANIM, -1);
Item_Spawn(item, O_MAGNUM_ITEM);
if (Inv_RequestItem(O_MAGNUM_ITEM)) {
Item_Spawn(item, O_MAG_AMMO_ITEM);
} else {
Item_Spawn(item, O_MAGNUM_ITEM);
}
Item_Spawn(item, O_SCION_ITEM2);
Item_Spawn(item, O_KEY_ITEM1);
}
Expand Down
7 changes: 6 additions & 1 deletion src/game/objects/creatures/skate_kid.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "game/objects/creatures/skate_kid.h"

#include "game/creature.h"
#include "game/inventory.h"
#include "game/items.h"
#include "game/lot.h"
#include "game/music.h"
Expand Down Expand Up @@ -85,7 +86,11 @@ void SkateKid_Control(int16_t item_num)
if (item->current_anim_state != SKATE_KID_DEATH) {
item->current_anim_state = SKATE_KID_DEATH;
Item_SwitchToAnim(item, SKATE_KID_DIE_ANIM, -1);
Item_Spawn(item, O_UZI_ITEM);
if (Inv_RequestItem(O_UZI_ITEM)) {
Item_Spawn(item, O_UZI_AMMO_ITEM);
} else {
Item_Spawn(item, O_UZI_ITEM);
}
}
} else {
AI_INFO info;
Expand Down

0 comments on commit 06f328b

Please sign in to comment.