Skip to content

Commit

Permalink
Merge pull request #6 from Hedgefog/next
Browse files Browse the repository at this point in the history
Update 1.0.0
  • Loading branch information
Hedgefog authored Dec 18, 2022
2 parents c055a97 + 015fcf6 commit 15443ae
Show file tree
Hide file tree
Showing 42 changed files with 1,697 additions and 882 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ __Snow Wars__ is a __Counter-Strike__ server-side modification based on snowball
#### Weapons and Artifacts

- Snowball - deals 50 damage on hit
- Slightshot - allows you to shoot snowballs with extra controlled power
- Slingshot - allows you to shoot snowballs with extra controlled power
- Lemon Juice - adds radius damage to your snowballs, it's yellow for a reason and enemies find it humiliating
- Down Jacket - reduces taken damage
- Surprise Box - SURPRISE, but in the box
Expand Down
37 changes: 21 additions & 16 deletions assets/addons/amxmodx/configs/plugins-snowwars.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,30 @@ api_custom_entities.amxx
api_custom_weapons.amxx

; Core
snowwars.amxx debug
sw_gamemode.amxx debug
sw_player_attributes.amxx debug
sw_player_artifacts.amxx debug
sw_shop.amxx debug
sw_bomb.amxx debug
sw_player.amxx debug
snowwars.amxx
sw_gamemode.amxx
sw_player_attributes.amxx
sw_player_artifacts.amxx
sw_shop.amxx
sw_bomb.amxx
sw_player.amxx

; Entities
sw_entity_snowball.amxx debug
sw_entity_item_artifact.amxx debug
sw_entity_fireworkrocket.amxx debug
sw_entity_fireworksbox.amxx debug
sw_entity_snowball.amxx
sw_entity_item_artifact.amxx
sw_entity_fireworkrocket.amxx
sw_entity_fireworksbox.amxx
sw_entity_snowman.amxx

; Weapons
sw_weapon_snowball.amxx debug
sw_weapon_slingshot.amxx debug
sw_weapon_fireworksbox.amxx debug
sw_weapon_snowball.amxx
sw_weapon_slingshot.amxx
sw_weapon_fireworksbox.amxx
sw_weapon_snowman.amxx

; Artifacts
sw_artifact_downjacket.amxx debug
sw_artifact_lemonjuice.amxx debug
sw_artifact_downjacket.amxx
sw_artifact_lemonjuice.amxx

; Bots
sw_bots_autobuy.amxx
Binary file removed assets/models/snowwars/v090/weapons/v_snowball.mdl
Binary file not shown.
Binary file added assets/models/snowwars/v100/snowman.mdl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added assets/sound/snowwars/v100/return.wav
Binary file not shown.
11 changes: 0 additions & 11 deletions assets/sprites/snowwars/v090/weapon_fireworksbox.txt

This file was deleted.

11 changes: 0 additions & 11 deletions assets/sprites/snowwars/v090/weapon_slingshot.txt

This file was deleted.

11 changes: 0 additions & 11 deletions assets/sprites/snowwars/v090/weapon_snowball.txt

This file was deleted.

Binary file added assets/sprites/snowwars/v100/640hud1.spr
Binary file not shown.
Binary file added assets/sprites/snowwars/v100/640hud2.spr
Binary file not shown.
Binary file added assets/sprites/snowwars/v100/640hud3.spr
Binary file not shown.
6 changes: 6 additions & 0 deletions assets/sprites/snowwars/v100/weapon_fireworksbox.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
5
weapon 640 snowwars/v100/640hud2 0 90 170 45
weapon_s 640 snowwars/v100/640hud3 0 90 170 45
ammo 640 640hud7 168 232 24 24
crosshair 640 crosshairs 24 0 24 24
autoaim 640 crosshairs 0 72 24 24
6 changes: 6 additions & 0 deletions assets/sprites/snowwars/v100/weapon_slingshot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
5
weapon 640 snowwars/v100/640hud2 0 45 170 45
weapon_s 640 snowwars/v100/640hud3 0 45 170 45
ammo 640 640hud7 168 232 24 24
crosshair 640 crosshairs 24 0 24 24
autoaim 640 crosshairs 0 72 24 24
6 changes: 6 additions & 0 deletions assets/sprites/snowwars/v100/weapon_snowball.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
5
weapon 640 snowwars/v100/640hud2 0 0 170 45
weapon_s 640 snowwars/v100/640hud3 0 0 170 45
ammo 640 640hud7 168 232 24 24
crosshair 640 crosshairs 24 0 24 24
autoaim 640 crosshairs 0 72 24 24
6 changes: 6 additions & 0 deletions assets/sprites/snowwars/v100/weapon_snowman.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
5
weapon 640 snowwars/v100/640hud2 0 135 170 45
weapon_s 640 snowwars/v100/640hud3 0 135 170 45
ammo 640 snowwars/v100/640hud1 0 0 24 24
crosshair 640 crosshairs 24 0 24 24
autoaim 640 crosshairs 0 72 24 24
4 changes: 2 additions & 2 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": "snowwars",
"version": "0.9.2",
"version": "1.0.0",
"author": "Hedgehog Fog",
"description": "Snow Wars Mod",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/include/api_custom_weapons.inc
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,6 @@ native CW_GetPlayer(pItem);
native CW_RemovePlayerItem(pItem);

native CW_GiveWeapon(pPlayer, const szWeapon[]);
native bool:CW_HasWeapon(pPlayer, const szWeapon[]);
native CW_SpawnWeapon(CW:iHandler);
native CW_SpawnWeaponBox(CW:iHandler);
38 changes: 32 additions & 6 deletions src/include/snowwars.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
/**/
/*
1.0.0
Additions and improvements:
Added snowman
Increased Lemon Juice splash damage
CTs team now has a defuse kit by default
Reduced the max firing pitch for fireworks box rocket
Reduced surprise box price
Fixes:
Fixed a bug where the down jacket had the wrong skin after auto team change
Fixed weapons secondary attack behavior
Fixed snowball view model (by Psycrow)
Fixed fireworks box player model (by Psycrow)
*/

#if defined _snowwars_included
#endinput
Expand All @@ -10,17 +24,23 @@
#include <snowwars_const>

enum SW_PlayerAttribute {
SW_PlayerAttribute_Resistance = 0,
SW_PlayerAttribute_Power
SW_PlayerAttribute_Resistance = 0,
SW_PlayerAttribute_Power
}

enum SW_ShopItemType {
SW_ShopItemType_Invalid = -1,
SW_ShopItemType_Weapon = 0,
SW_ShopItemType_Artifact
}

native any:SW_Player_GetAttribute(pPlayer, SW_PlayerAttribute:iAttrib);
native SW_Player_SetAttribute(pPlayer, SW_PlayerAttribute:iAttrib, any:value);

native SW_PlayerArtifact_Register(
const szId[],
const szActivateFunc[],
const szDeactivateFunc[]
const szId[],
const szActivateFunc[],
const szDeactivateFunc[]
);
native SW_PlayerArtifact_GetHandler(const szId[]);

Expand All @@ -29,3 +49,9 @@ native bool:SW_Player_TakeArtifact(pPlayer, const szId[]);
native bool:SW_Player_TakeArtifactBySlot(pPlayer, iSlot);
native bool:SW_Player_HasArtifact(pPlayer, const szId[]);
native SW_Player_FindArtifact(pPlayer, iOffset, szId[], iLen);

native SW_Shop_Player_BuyItem(pPlayer, const szItem[]);
native SW_Shop_Item_GetPrice(const szItem[]);
native SW_Shop_Item_GetType(const szItem[]);

forward SW_Shop_Fw_Buy(pPlayer, const szItem[]);
55 changes: 54 additions & 1 deletion src/include/snowwars_const.inc
Original file line number Diff line number Diff line change
@@ -1,2 +1,55 @@
#define SW_TITLE "Snow Wars"
#define SW_VERSION "0.9.1"
#define SW_VERSION "1.0.0"

stock const SW_WEAPON_SNOWBALL[] = "snowwars/v100/weapon_snowball";
stock const SW_WEAPON_SLINGSHOT[] = "snowwars/v100/weapon_slingshot";
stock const SW_WEAPON_FIREWORKSBOX[] = "snowwars/v100/weapon_fireworksbox";
stock const SW_WEAPON_SNOWMAN[] = "snowwars/v100/weapon_snowman";

stock const SW_ARTIFACT_DOWNJACKET[] = "downjacket";
stock const SW_ARTIFACT_LEMONJUICE[] = "lemonjuice";

stock const SW_WEAPON_SNOWBALL_HUD_TXT[] = "sprites/snowwars/v100/weapon_snowball.txt";
stock const SW_WEAPON_SLINGSHOT_HUD_TXT[] = "sprites/snowwars/v100/weapon_slingshot.txt";
stock const SW_WEAPON_FIREWORKSBOX_HUD_TXT[] = "sprites/snowwars/v100/weapon_fireworksbox.txt";
stock const SW_WEAPON_SNOWMAN_HUD_TXT[] = "sprites/snowwars/v100/weapon_snowman.txt";

stock const SW_MODEL_SNOWMAN[] = "models/snowwars/v100/snowman.mdl";

stock const SW_MODEL_WEAPON_SNOWBALL_V[] = "models/snowwars/v100/weapons/v_snowball.mdl";
stock const SW_MODEL_WEAPON_SNOWBALL_P[] = "models/snowwars/v090/weapons/p_snowball.mdl";
stock const SW_MODEL_WEAPON_SNOWBALL_W[] = "models/snowwars/v090/weapons/w_snowball.mdl";
stock const SW_MODEL_WEAPON_SNOWBALL_LEMON_W[] = "models/snowwars/v090/weapons/w_snowball_lemon.mdl";

stock const SW_MODEL_WEAPON_SLINGSHOT_V[] = "models/snowwars/v090/weapons/v_slingshot.mdl";
stock const SW_MODEL_WEAPON_SLINGSHOT_P[] = "models/snowwars/v090/weapons/p_slingshot.mdl";
stock const SW_MODEL_WEAPON_SLINGSHOT_W[] = "models/snowwars/v090/weapons/w_slingshot.mdl";

stock const SW_MODEL_WEAPON_FIREWORKSBOX_V[] = "models/snowwars/v090/weapons/v_fireworksbox.mdl";
stock const SW_MODEL_WEAPON_FIREWORKSBOX_P[] = "models/snowwars/v100/weapons/p_fireworksbox.mdl";
stock const SW_MODEL_WEAPON_FIREWORKSBOX_W[] = "models/snowwars/v090/weapons/w_fireworksbox.mdl";

stock const SW_MODEL_WEAPON_SNOWMAN_V[] = "";
stock const SW_MODEL_WEAPON_SNOWMAN_P[] = "";
stock const SW_MODEL_WEAPON_SNOWMAN_W[] = "models/snowwars/v100/weapons/w_snowman.mdl";

stock const SW_MODEL_ARTIFACT_DOWNJACKET_W[] = "models/snowwars/v090/artifacts/w_downjacket.mdl";
stock const SW_MODEL_ARTIFACT_DOWNJACKET_P[] = "models/snowwars/v090/artifacts/p_downjacket.mdl";

stock const SW_MODEL_ARTIFACT_LEMONJUICE_W[] = "models/snowwars/v090/artifacts/w_lemonsnow.mdl";

stock const SW_SPRITE_HUD[][] = {
"sprites/snowwars/v100/640hud1.spr",
"sprites/snowwars/v100/640hud2.spr",
"sprites/snowwars/v100/640hud3.spr"
};

stock const SW_SOUND_SNOWBALL_THROW[] = "snowwars/v090/snowthrow1.wav";
stock const SW_SOUND_SNOWBALL_HIT[] = "snowwars/v090/sbhit.wav";
stock const SW_SOUND_SNOWBALL_LEMON_HIT[] = "debris/bustflesh1.wav";
stock const SW_SOUND_JINGLE_MUSIC[] = "snowwars/v090/christmas_jingle.wav";
stock const SW_SOUND_FIREWORK_ROCKET[] = "snowwars/v090/rocket1.wav";
stock const SW_SOUND_DOWNJACKET[] = "snowwars/v090/pw_shield.wav";
stock const SW_SOUND_PLAYER_SPAWN[] = "snowwars/v090/push.wav";
stock const SW_SOUND_RETURN[] = "snowwars/v100/return.wav";
stock const SW_SOUND_PLAYER_HIT[][] = { "snowwars/v090/snowhit_human1.wav", "snowwars/v090/snowhit_human2.wav" };
41 changes: 40 additions & 1 deletion src/scripts/api/api_custom_weapons.sma
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <api_custom_weapons>

#define PLUGIN "[API] Custom Weapons"
#define VERSION "0.7.3"
#define VERSION "0.7.4"
#define AUTHOR "Hedgehog Fog"

#define WALL_PUFF_SPRITE "sprites/wall_puff1.spr"
Expand Down Expand Up @@ -139,6 +139,7 @@ public plugin_natives() {
register_native("CW_GetWeaponData", "Native_GetWeaponData");
register_native("CW_GetWeaponStringData", "Native_GetWeaponStringData");
register_native("CW_GiveWeapon", "Native_GiveWeapon");
register_native("CW_HasWeapon", "Native_HasWeapon");
register_native("CW_SpawnWeapon", "Native_SpawnWeapon");
register_native("CW_SpawnWeaponBox", "Native_SpawnWeaponBox");

Expand Down Expand Up @@ -250,6 +251,21 @@ public Native_GiveWeapon(iPluginId, iArgc) {
}
}


public bool:Native_HasWeapon(iPluginId, iArgc) {
new pPlayer = get_param(1);

static szWeapon[64];
get_string(2, szWeapon, charsmax(szWeapon));

new CW:iHandler;
if (TrieGetCell(g_rgWeaponsMap, szWeapon, iHandler)) {
return HasWeapon(pPlayer, iHandler);
}

return false;
}

public Native_SpawnWeapon(iPluginId, iArgc) {
new CW:iHandler = CW:get_param(1);
return SpawnWeapon(iHandler);
Expand Down Expand Up @@ -1624,6 +1640,29 @@ GiveWeapon(pPlayer, CW:iHandler) {
ExecuteHamB(Ham_Item_AttachToPlayer, pWeapon, pPlayer);
emit_sound(pPlayer, CHAN_ITEM, "items/gunpickup2.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
}

new iClipSize = GetData(iHandler, CW_Data_ClipSize);
new iPrimaryAmmoIndex = GetData(iHandler, CW_Data_PrimaryAmmoType);
if (iClipSize == WEAPON_NOCLIP && iPrimaryAmmoIndex != -1) {
set_member(pPlayer, m_rgAmmo, get_member(pPlayer, m_rgAmmo, iPrimaryAmmoIndex) + 1, iPrimaryAmmoIndex);
}
}

bool:HasWeapon(pPlayer, CW:iHandler) {
new iSlot = GetData(iHandler, CW_Data_SlotId);

new pItem = get_member(pPlayer, m_rgpPlayerItems, iSlot);
while (pItem != -1) {
new pNextItem = get_member(pItem, m_pNext);

if (CW_GetHandlerByEntity(pItem) == iHandler) {
return true;
}

pItem = pNextItem;
}

return false;
}

UpdateWeaponList(pPlayer, CW:iHandler) {
Expand Down
Loading

0 comments on commit 15443ae

Please sign in to comment.