Skip to content

Commit efc2822

Browse files
authored
Merge pull request #67 from Hedgefog/master
Update 6.4.1
2 parents 22ebfe5 + f151a6a commit efc2822

File tree

7 files changed

+83
-48
lines changed

7 files changed

+83
-48
lines changed

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
![Alt Text](./images/demo.gif)
2-
### Halloween Mod for Counter-Strike 1.6
3-
__Version:__ 6.4.0
2+
## 🎃 Halloween Mod 🇺🇦
3+
![GitHub package.json version](https://img.shields.io/github/package-json/v/hedgefog/cs-halloween-mod)
4+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/hedgefog/cs-halloween-mod/CI)
5+
![GitHub release (latest by date)](https://img.shields.io/github/v/release/hedgefog/cs-halloween-mod)
6+
![GitHub all releases](https://img.shields.io/github/downloads/hedgefog/cs-halloween-mod/total)
47

5-
### What is Halloween Mod?
6-
Halloween mod is a powerful Halloween-themed core for your server with completely new game modes, NPCs, bosses, spells, cosmetics, and more.
8+
### 📄 About
9+
__Halloween Mod__ is a powerful Halloween-themed core for your __Counter-Strike__ server with completely new game modes, NPCs, bosses, spells, cosmetics, and more.
710

8-
### Download latest:
11+
### 🔽 Download latest:
912
- [Releases](./releases)
1013

11-
### Documentation
14+
### 🔄 Requirements
15+
- Amx Mod X 1.8.2+
16+
- RegameDLL + ReAPI or RoundControl
17+
- Metamod-R or Metamod-P (for windows)
18+
19+
### 📖 Documentation
1220
- [Index](./doc/pages/index.md)
1321

14-
### Special Thanks:
22+
### 🙏 Special Thanks:
1523
- [Credits](./CREDITS.md)
1624

17-
### Deployment
25+
### 🔧 Deployment
1826
- Clone repository.
19-
- Extract compiler executable and includes to _"compiler"_ folder of project.
20-
- Extract ReAPI module to _"thirdparty/reapi"_ folder of project (example: _"thirdparty/reapi/addons"_).
2127
- Install dependencies `npm i`
2228

2329
#### Customize builder

package-lock.json

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "halloween-mod",
3-
"version": "6.4.0",
3+
"version": "6.4.1",
44
"description": "Halloween Mod",
55
"scripts": {
66
"build": "npm run build:vanilla && npm run build:reapi",

src/include/hwn.inc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
/*
2+
6.4.1
3+
Fixes:
4+
Fixed HHH NPC pathfinding
5+
Pumpkin no longer drops on suicide
6+
27
6.4.0
38
Additions and improvements:
49
Added Skeletons Horde spell
@@ -336,7 +341,7 @@
336341
#define HWN_COLOR_SECONDARY HWN_COLOR_GREEN_DARK
337342

338343
#define HWN_TITLE "Halloween Mod"
339-
#define HWN_VERSION "6.4.0"
344+
#define HWN_VERSION "6.4.1"
340345

341346
enum _:Hwn_PumpkinType
342347
{

src/include/hwn_npc_stocks.inc

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ stock bool:NPC_TestStep(ent, const Float:vOrigin[3], const Float:vStep[3], Float
286286

287287
stock bool:NPC_GetTarget(ent, Float:fSpeed, Float:vTarget[3], bool:reachableOnly = true, bool:visibleOnly = true)
288288
{
289-
new enemy = pev(ent, pev_enemy);
289+
new enemy = NPC_GetEnemy(ent);
290290
if (!enemy) {
291291
return false;
292292
}
@@ -418,6 +418,17 @@ stock bool:NPC_MoveToTarget(ent, const Float:vTarget[3], Float:fSpeed, Float:fMa
418418
return turnResult;
419419
}
420420

421+
stock NPC_StopMovement(ent)
422+
{
423+
static Float:vVelocity[3];
424+
pev(ent, pev_velocity, vVelocity);
425+
426+
vVelocity[0] = 0.0;
427+
vVelocity[1] = 0.0;
428+
429+
set_pev(ent, pev_velocity, vVelocity);
430+
}
431+
421432
stock NPC_MoveForward(ent, Float:fSpeed)
422433
{
423434
static Float:vDirection[3];
@@ -487,6 +498,16 @@ stock NPC_IsVisible(ent, const Float:vTarget[3])
487498
return UTIL_IsOpen(vOrigin, vTarget, ent);
488499
}
489500

501+
stock NPC_GetEnemy(ent) {
502+
new enemy = pev(ent, pev_enemy);
503+
504+
if (!NPC_IsValidEnemy(enemy)) {
505+
enemy = 0;
506+
}
507+
508+
return enemy;
509+
}
510+
490511
stock NPC_SetEnemy(ent, enemy)
491512
{
492513
set_pev(ent, pev_enemy, enemy);

src/scripts/entities/entity_hwn_npc_hhh.sma

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ public OnKill(ent)
259259
NPC_EmitVoice(ent, g_szSndDying, .supercede = true);
260260
NPC_PlayAction(ent, g_actions[Action_Shake], .supercede = true);
261261

262+
NPC_StopMovement(ent);
262263
set_pev(ent, pev_takedamage, DAMAGE_NO);
263-
set_pev(ent, pev_velocity, Float:{0.0, 0.0, 0.0});
264264
set_pev(ent, pev_deadflag, DEAD_DYING);
265265

266266
remove_task(ent);
@@ -299,24 +299,29 @@ public OnThink(ent)
299299
set_pev(ent, pev_takedamage, DAMAGE_AIM);
300300
}
301301

302-
new enemy = pev(ent, pev_enemy);
302+
new enemy = NPC_GetEnemy(ent);
303303
new Action:action = Action_Idle;
304-
new bool:isValidEnemy = NPC_IsValidEnemy(enemy);
305304

306305
static Float:fLastUpdate;
307306
pev(ent, pev_fuser1, fLastUpdate);
308307
new bool:shouldUpdate = get_gametime() - fLastUpdate >= g_fThinkDelay;
309308

310-
if (isValidEnemy) {
309+
if (enemy) {
311310
Attack(ent, enemy, action, shouldUpdate);
311+
enemy = NPC_GetEnemy(ent);
312+
}
313+
314+
if (enemy && shouldUpdate) {
315+
AStar_Reset(ent);
312316
}
313317

314318
if (shouldUpdate) {
315-
if (!isValidEnemy) {
316-
isValidEnemy = NPC_FindEnemy(ent, g_maxPlayers, NPC_ViewRange);
319+
if (!enemy) {
320+
NPC_FindEnemy(ent, g_maxPlayers, NPC_ViewRange);
321+
enemy = NPC_GetEnemy(ent);
317322
}
318323

319-
if (!isValidEnemy && get_pcvar_num(g_cvarUseAstar) > 0) {
324+
if (!enemy && get_pcvar_num(g_cvarUseAstar) > 0) {
320325
AStar_Attack(ent, action);
321326
}
322327

@@ -454,7 +459,7 @@ bool:Attack(ent, target, &Action:action, bool:checkTarget = false)
454459
if (checkTarget) {
455460
if (!NPC_GetTarget(ent, NPC_Speed, vTarget)) {
456461
NPC_SetEnemy(ent, 0);
457-
set_pev(ent, pev_velocity, Float:{0.0, 0.0, 0.0});
462+
NPC_StopMovement(ent);
458463
set_pev(ent, pev_vuser1, vOrigin);
459464
return false;
460465
}
@@ -488,11 +493,9 @@ bool:Attack(ent, target, &Action:action, bool:checkTarget = false)
488493
action = (action == Action_Attack) ? Action_RunAttack : Action_Run;
489494
NPC_MoveToTarget(ent, vTarget, NPC_Speed);
490495
} else {
491-
set_pev(ent, pev_velocity, Float:{0.0, 0.0, 0.0});
496+
NPC_StopMovement(ent);
492497
}
493498

494-
AStar_Reset(ent);
495-
496499
return true;
497500
}
498501

src/scripts/gamemodes/hwn_gamemode_collector.sma

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,17 @@ public OnMessageStatusIcon(msg, dest, id)
188188
return PLUGIN_CONTINUE;
189189
}
190190

191-
public OnPlayerKilled(id)
191+
public OnPlayerKilled(id, killer)
192192
{
193193
if (g_hGamemode != Hwn_Gamemode_GetCurrent()) {
194194
return;
195195
}
196196

197-
ExtractPlayerPoints(id);
197+
new points = GetPlayerPoints(id);
198+
199+
if (points || (killer != id && !Hwn_Gamemode_IsPlayerOnSpawn(id))) {
200+
ExtractPlayerPoints(id);
201+
}
198202
}
199203

200204
public OnTargetKilled(ent)
@@ -332,10 +336,6 @@ bool:ExtractPlayerPoints(id)
332336
static Float:vOrigin[3];
333337
pev(id, pev_origin, vOrigin);
334338

335-
if (Hwn_Gamemode_IsPlayerOnSpawn(id) && !points) {
336-
return false;
337-
}
338-
339339
new bool:isBackpack = points > 1;
340340
new bpEnt = CE_Create(isBackpack ? BACKPACK_ENTITY_CLASSNAME : LOOT_ENTITY_CLASSNAME, vOrigin);
341341
if (!bpEnt) {

0 commit comments

Comments
 (0)