Skip to content

Commit

Permalink
Merge pull request #71 from Hedgefog/master
Browse files Browse the repository at this point in the history
Release 6.4.2
  • Loading branch information
Hedgefog authored Jul 26, 2023
2 parents efc2822 + bf0b326 commit 018d562
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 32 deletions.
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"klippy.amxxpawn-language"
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Hedgehog Fog

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Alt Text](./images/demo.gif)
## 🎃 Halloween Mod 🇺🇦
![GitHub package.json version](https://img.shields.io/github/package-json/v/hedgefog/cs-halloween-mod)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/hedgefog/cs-halloween-mod/CI)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/hedgefog/cs-halloween-mod/build.yml?branch=release)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/hedgefog/cs-halloween-mod)
![GitHub all releases](https://img.shields.io/github/downloads/hedgefog/cs-halloween-mod/total)

Expand All @@ -12,9 +12,10 @@ __Halloween Mod__ is a powerful Halloween-themed core for your __Counter-Strike_
- [Releases](./releases)

### 🔄 Requirements
- Amx Mod X 1.8.2+
- RegameDLL + ReAPI or RoundControl
- Metamod-R or Metamod-P (for windows)
- [Metamod-R](https://github.com/theAsmodai/metamod-r) + [ReHLDS](https://github.com/dreamstalker/rehlds) or [Metamod-P](https://github.com/Bots-United/metamod-p)
- [RegameDLL](https://github.com/s1lentq/ReGameDLL_CS)
- [Amx Mod X 1.8.2+](https://www.amxmodx.org/downloads-new.php)
- [ReAPI](https://github.com/s1lentq/reapi)

### 📖 Documentation
- [Index](./doc/pages/index.md)
Expand Down
55 changes: 36 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "halloween-mod",
"version": "6.4.1",
"version": "6.4.2",
"description": "Halloween Mod",
"scripts": {
"build": "npm run build:vanilla && npm run build:reapi",
Expand Down
6 changes: 5 additions & 1 deletion src/include/hwn.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/*
6.4.2
Fixes:
Fixed objective marks spawn
6.4.1
Fixes:
Fixed HHH NPC pathfinding
Expand Down Expand Up @@ -341,7 +345,7 @@
#define HWN_COLOR_SECONDARY HWN_COLOR_GREEN_DARK

#define HWN_TITLE "Halloween Mod"
#define HWN_VERSION "6.4.1"
#define HWN_VERSION "6.4.2"

enum _:Hwn_PumpkinType
{
Expand Down
45 changes: 38 additions & 7 deletions src/scripts/extra/hwn_objective_marks.sma
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ new g_iszInfoTargetClassname;
public plugin_precache() {
g_irgMarks = ArrayCreate(_, MAX_PLAYER_MARKS);
g_iMarkModelIndex = precache_model("sprites/hwn/mark_cauldron.spr");
g_iszInfoTargetClassname = engfunc(EngFunc_AllocString, "info_target");

CE_RegisterHook(CEFunction_Spawn, "hwn_bucket", "OnBucketSpawn_Post");
g_iszInfoTargetClassname = engfunc(EngFunc_AllocString, "info_target");
CE_RegisterHook(CEFunction_Remove, "hwn_bucket", "OnBucketRemove_Post");
}

public plugin_init() {
Expand All @@ -85,9 +86,17 @@ public OnBucketSpawn_Post(pEntity) {
return;
}

new pMark = CreateMark(pEntity);
set_pev(pMark, pev_iuser1, ArraySize(g_irgMarks));
ArrayPushCell(g_irgMarks, pMark);
if (!pev(pEntity, pev_euser1)) {
new pMark = CreateMark(pEntity);
set_pev(pEntity, pev_euser1, pMark);
}
}

public OnBucketRemove_Post(pEntity) {
new pMark = pev(pEntity, pev_euser1);
if (pMark > 0) {
DestroyMark(pMark);
}
}

public OnPlayerSpawn_Post(pPlayer) {
Expand Down Expand Up @@ -199,8 +208,9 @@ public OnCheckVisibility(pEntity) {
return FMRES_SUPERCEDE;
}

CreateMark(pButton) {
CreateMark(pEntity) {
new pMark = engfunc(EngFunc_CreateNamedEntity, g_iszInfoTargetClassname);
new iMarkIndex = ArraySize(g_irgMarks);

set_pev(pMark, pev_classname, MARK_CLASSNAME);
set_pev(pMark, pev_scale, SPRITE_SCALE);
Expand All @@ -210,17 +220,38 @@ CreateMark(pButton) {
set_pev(pMark, pev_movetype, MOVETYPE_FLYMISSILE);
set_pev(pMark, pev_solid, SOLID_NOT);
set_pev(pMark, pev_spawnflags, SF_SPRITE_STARTON);
set_pev(pMark, pev_owner, pButton);
set_pev(pMark, pev_owner, pEntity);
set_pev(pMark, pev_iuser1, iMarkIndex);

dllfunc(DLLFunc_Spawn, pMark);

static Float:vecOrigin[3];
ExecuteHam(Ham_BodyTarget, pButton, 0, vecOrigin);
ExecuteHam(Ham_BodyTarget, pEntity, 0, vecOrigin);
engfunc(EngFunc_SetOrigin, pMark, vecOrigin);

ArrayPushCell(g_irgMarks, pMark);

return pMark;
}

DestroyMark(pMark) {
new iMarkIndex = pev(pMark, pev_iuser1);

set_pev(pMark, pev_flags, pev(pMark, pev_flags) | FL_KILLME);
dllfunc(DLLFunc_Think, pMark);

ArrayDeleteItem(g_irgMarks, iMarkIndex);
ReindexMarks();
}

ReindexMarks() {
new iMarkCount = ArraySize(g_irgMarks);
for (new iMarkIndex = 0; iMarkIndex < iMarkCount; ++iMarkIndex) {
new pMark = ArrayGetCell(g_irgMarks, iMarkIndex);
set_pev(pMark, pev_iuser1, iMarkIndex);
}
}

CalculateMark(pMark, pPlayer) {
new iMarkIndex = pev(pMark, pev_iuser1);
new Float:flDelta = get_gametime() - g_rgPlayerData[pPlayer][iMarkIndex][Player_MarkUpdateTime];
Expand Down

0 comments on commit 018d562

Please sign in to comment.