-
Notifications
You must be signed in to change notification settings - Fork 107
Exposing detailed knife details #431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
5c94794
94767d6
f796928
25f3d76
15daf5e
5fb46b3
2bd6010
1a4fcdb
3505ba3
85fcd76
d71becb
3256112
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,6 +118,25 @@ const ( | |
EqWrench EquipmentType = 419 | ||
EqSnowball EquipmentType = 420 | ||
EqBumpMine EquipmentType = 421 | ||
EqKnifeBayonet EquipmentType = 422 | ||
EqKnifeCSS EquipmentType = 423 | ||
EqKnifeFlip EquipmentType = 424 | ||
EqKnifeGut EquipmentType = 425 | ||
EqKnifeKarambit EquipmentType = 426 | ||
EqKnifeM9Bayonet EquipmentType = 427 | ||
EqKnifeTactical EquipmentType = 428 | ||
EqKnifeFalchion EquipmentType = 429 | ||
EqKnifeSurvivalBowie EquipmentType = 430 | ||
EqKnifeButterfly EquipmentType = 431 | ||
EqKnifePush EquipmentType = 432 | ||
EqKnifeCord EquipmentType = 433 | ||
EqKnifeCanis EquipmentType = 434 | ||
EqKnifeUrsus EquipmentType = 435 | ||
EqKnifeGypsyJackknife EquipmentType = 436 | ||
EqKnifeOutdoor EquipmentType = 437 | ||
EqKnifeStiletto EquipmentType = 438 | ||
EqKnifeWidowmaker EquipmentType = 439 | ||
EqKnifeSkeleton EquipmentType = 440 | ||
|
||
// Grenades | ||
|
||
|
@@ -204,6 +223,28 @@ func initEqNameToWeapon() { | |
eqNameToWeapon["vesthelm"] = EqHelmet | ||
eqNameToWeapon["defuser"] = EqDefuseKit | ||
|
||
eqNameToWeapon["knife"] = EqKnife | ||
eqNameToWeapon["bayonet"] = EqKnifeBayonet | ||
eqNameToWeapon["knife_bayonet"] = EqKnifeBayonet | ||
eqNameToWeapon["knife_css"] = EqKnifeCSS | ||
eqNameToWeapon["knife_flip"] = EqKnifeFlip | ||
eqNameToWeapon["knife_gut"] = EqKnifeGut | ||
eqNameToWeapon["knife_karambit"] = EqKnifeKarambit | ||
eqNameToWeapon["knife_m9_bayonet"] = EqKnifeM9Bayonet | ||
eqNameToWeapon["knife_tactical"] = EqKnifeTactical | ||
eqNameToWeapon["knife_falchion"] = EqKnifeFalchion | ||
eqNameToWeapon["knife_survival_bowie"] = EqKnifeSurvivalBowie | ||
eqNameToWeapon["knife_butterfly"] = EqKnifeButterfly | ||
eqNameToWeapon["knife_push"] = EqKnifePush | ||
eqNameToWeapon["knife_cord"] = EqKnifeCord | ||
eqNameToWeapon["knife_canis"] = EqKnifeCanis | ||
eqNameToWeapon["knife_ursus"] = EqKnifeUrsus | ||
eqNameToWeapon["knife_gypsy_jackknife"] = EqKnifeGypsyJackknife | ||
eqNameToWeapon["knife_outdoor"] = EqKnifeOutdoor | ||
eqNameToWeapon["knife_stiletto"] = EqKnifeStiletto | ||
eqNameToWeapon["knife_widowmaker"] = EqKnifeWidowmaker | ||
eqNameToWeapon["knife_skeleton"] = EqKnifeSkeleton | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here, would need to be moved to the new map I wrote about |
||
|
||
// These don't exist and / or used to crash the game with the give command | ||
eqNameToWeapon["scar17"] = EqUnknown | ||
eqNameToWeapon["sensorgrenade"] = EqUnknown | ||
|
@@ -267,6 +308,25 @@ func initEqElementToName() { | |
eqElementToName[EqDefuseKit] = "Defuse Kit" | ||
eqElementToName[EqKnife] = "Knife" | ||
eqElementToName[EqUnknown] = "UNKNOWN" | ||
eqElementToName[EqKnifeBayonet] = "Bayonet" | ||
eqElementToName[EqKnifeCSS] = "CSS Knife" | ||
eqElementToName[EqKnifeFlip] = "Flip Knife" | ||
eqElementToName[EqKnifeGut] = "Gut Knife" | ||
eqElementToName[EqKnifeKarambit] = "Karambit" | ||
eqElementToName[EqKnifeM9Bayonet] = "M9 Bayonet" | ||
eqElementToName[EqKnifeTactical] = "Tactical Knife" | ||
eqElementToName[EqKnifeFalchion] = "Falchion Knife" | ||
eqElementToName[EqKnifeSurvivalBowie] = "Survival Bowie Knife" | ||
eqElementToName[EqKnifeButterfly] = "Butterfly Knife" | ||
eqElementToName[EqKnifePush] = "Push Knife" | ||
eqElementToName[EqKnifeCord] = "Cord Knife" | ||
eqElementToName[EqKnifeCanis] = "Canis Knife" | ||
eqElementToName[EqKnifeUrsus] = "Ursus Knife" | ||
eqElementToName[EqKnifeGypsyJackknife] = "Gypsy Jackknife" | ||
eqElementToName[EqKnifeOutdoor] = "Outdoor Knife" | ||
eqElementToName[EqKnifeStiletto] = "Stiletto Knife" | ||
eqElementToName[EqKnifeWidowmaker] = "Widowmaker Knife" | ||
eqElementToName[EqKnifeSkeleton] = "Skeleton Knife" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this would have to be in a new map |
||
} | ||
|
||
const weaponPrefix = "weapon_" | ||
|
@@ -300,9 +360,10 @@ const ( | |
// Equipment is a weapon / piece of equipment belonging to a player. | ||
// This also includes the skin and some additional data. | ||
type Equipment struct { | ||
Type EquipmentType // The type of weapon which the equipment instantiates. | ||
Entity st.Entity // The game entity instance | ||
Owner *Player // The player carrying the equipment, not necessarily the buyer. | ||
Type EquipmentType // The type of weapon which the equipment instantiates. | ||
Entity st.Entity // The game entity instance | ||
Owner *Player // The player carrying the equipment, not necessarily the buyer. | ||
RawEquipment EquipmentType // More information about the equipment eq. the different knives. | ||
// E.g. 'models/weapons/w_rif_m4a1_s.mdl'. | ||
// Used internally to differentiate alternative weapons (M4A4 / M4A1-S etc.) for Source 1 demos. | ||
// It's always an empty string with Source 2 demos, you should use Type to know which weapon it is. | ||
|
@@ -543,23 +604,23 @@ var EquipmentIndexMapping = map[uint64]EquipmentType{ | |
83: EqHE, // weapon_frag_grenade | ||
84: EqSnowball, // weapon_snowball | ||
85: EqBumpMine, // weapon_bumpmine | ||
500: EqKnife, // weapon_bayonet | ||
503: EqKnife, // weapon_knife_css | ||
505: EqKnife, // weapon_knife_flip | ||
506: EqKnife, // weapon_knife_gut | ||
507: EqKnife, // weapon_knife_karambit | ||
508: EqKnife, // weapon_knife_m9_bayonet | ||
509: EqKnife, // weapon_knife_tactical | ||
512: EqKnife, // weapon_knife_falchion | ||
514: EqKnife, // weapon_knife_survival_bowie | ||
515: EqKnife, // weapon_knife_butterfly | ||
516: EqKnife, // weapon_knife_push | ||
517: EqKnife, // weapon_knife_cord | ||
518: EqKnife, // weapon_knife_canis | ||
519: EqKnife, // weapon_knife_ursus | ||
520: EqKnife, // weapon_knife_gypsy_jackknife | ||
521: EqKnife, // weapon_knife_outdoor | ||
522: EqKnife, // weapon_knife_stiletto | ||
523: EqKnife, // weapon_knife_widowmaker | ||
525: EqKnife, // weapon_knife_skeleton | ||
500: EqKnifeBayonet, // weapon_bayonet | ||
503: EqKnifeCSS, // weapon_knife_css | ||
505: EqKnifeFlip, // weapon_knife_flip | ||
506: EqKnifeGut, // weapon_knife_gut | ||
507: EqKnifeKarambit, // weapon_knife_karambit | ||
508: EqKnifeM9Bayonet, // weapon_knife_m9_bayonet | ||
509: EqKnifeTactical, // weapon_knife_tactical | ||
512: EqKnifeFalchion, // weapon_knife_falchion | ||
514: EqKnifeSurvivalBowie, // weapon_knife_survival_bowie | ||
515: EqKnifeButterfly, // weapon_knife_butterfly | ||
516: EqKnifePush, // weapon_knife_push | ||
517: EqKnifeCord, // weapon_knife_cord | ||
518: EqKnifeCanis, // weapon_knife_canis | ||
519: EqKnifeUrsus, // weapon_knife_ursus | ||
520: EqKnifeGypsyJackknife, // weapon_knife_gypsy_jackknife | ||
521: EqKnifeOutdoor, // weapon_knife_outdoor | ||
522: EqKnifeStiletto, // weapon_knife_stiletto | ||
523: EqKnifeWidowmaker, // weapon_knife_widowmaker | ||
525: EqKnifeSkeleton, // weapon_knife_skeleton | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these would need to be put in a new map as well |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
RawEquipment
part looks good now - but this part will need to be removed as it's not backwards compatible as mentioned in the other thread.So all we should do for now is expose
RawEquipment
.Maybe we can have a separate type
KnifeType
and constantsKnifeTypeXYZ
with a mapKnifeTypes map[string]KnifeType
which includes all known knife types to still provide some kind of mapping.The good thing about this is that if a new knife comes out the users can just add it to the map themselves,. as the map will be mutable.
I think this would be the best middleground