Skip to content

Commit 26e6dbe

Browse files
committed
Add new weapon data: include TT33, Makarov, and StechkinAPS in weapons.json with relevant stats
1 parent 4b6fe2e commit 26e6dbe

2 files changed

Lines changed: 126 additions & 77 deletions

File tree

Discordia/GameLogic/Weapons.py

Lines changed: 99 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -232,83 +232,6 @@ class Pistol(Firearm, MainHandEquipment, ABC):
232232
pass
233233

234234

235-
class WeblyRevolver(FromData, Pistol, FullyImplemented):
236-
"""
237-
Based on the Webly Mk. IV
238-
"""
239-
240-
241-
class M1911(FromData, Pistol, FullyImplemented):
242-
"""
243-
Based on the M1911
244-
"""
245-
246-
247-
class APS(FromData, Pistol, SelectiveFire, FullyImplemented):
248-
"""
249-
Based on the Stechkin automatic pistol (APS)
250-
"""
251-
252-
253-
class SMG(Firearm, MainHandEquipment, OffHandEquipment, ABC):
254-
pass
255-
256-
257-
class PPSh41(FromData, SMG, SelectiveFire, FullyImplemented):
258-
"""
259-
Based on the PPSh-41 (Shpagin machine pistol)
260-
"""
261-
262-
263-
class OwenSMG(FromData, SMG, FullyImplemented):
264-
"""
265-
Based on the Owen Machine Carbine (Australian)
266-
"""
267-
268-
269-
class Rifle(Firearm, MainHandEquipment, OffHandEquipment, ABC):
270-
pass
271-
272-
273-
class AK47(FromData, Rifle, SelectiveFire, FullyImplemented):
274-
"""
275-
Based on the AK-47
276-
"""
277-
278-
279-
class HKG3(FromData, Rifle, SelectiveFire, FullyImplemented):
280-
"""
281-
Based on the Heckler & Koch G3
282-
"""
283-
284-
285-
class Jezail(FromData, Rifle, FullyImplemented):
286-
"""
287-
Based on the Jezail Musket. Does 2x dmg if user is on a mountain.
288-
https://en.wikipedia.org/wiki/Jezail
289-
"""
290-
291-
def __init__(self):
292-
super().__init__()
293-
self.player: Optional[Actors.PlayerCharacter] = None
294-
295-
def on_equip(self, player_character: Actors.PlayerCharacter):
296-
super().on_equip(player_character)
297-
self.player = player_character
298-
299-
def on_unequip(self, player_character: Actors.PlayerCharacter):
300-
super().on_unequip(player_character)
301-
self.player = None
302-
303-
def calc_damage(self, distance: int) -> int:
304-
damage = super().calc_damage(distance)
305-
if self.player and isinstance(
306-
self.player.location.terrain, GameSpace.MountainTerrain
307-
):
308-
damage *= 2
309-
return damage
310-
311-
312235
class MachineGun(Firearm, MainHandEquipment, OffHandEquipment, ABC):
313236

314237
def __init__(self, mountable: bool = False, *args, **kwargs):
@@ -399,3 +322,102 @@ class Hammer(FromData, BluntWeapon, MainHandEquipment, FullyImplemented):
399322

400323
class Fist(FromData, BluntWeapon, MainHandEquipment, OffHandEquipment):
401324
"""Everyone starts with these; not FullyImplemented, so no store stocks them."""
325+
326+
327+
class SMG(Firearm, MainHandEquipment, OffHandEquipment, ABC):
328+
pass
329+
330+
331+
class MachinePistol(Firearm, MainHandEquipment, OffHandEquipment, ABC):
332+
pass
333+
334+
335+
class Rifle(Firearm, MainHandEquipment, OffHandEquipment, ABC):
336+
pass
337+
338+
339+
class WeblyRevolver(FromData, Pistol, FullyImplemented):
340+
"""
341+
Based on the Webly Mk. IV
342+
"""
343+
344+
345+
class TT33(FromData, Pistol, FullyImplemented):
346+
"""
347+
Based on the TT-33
348+
"""
349+
350+
351+
class Makarov(FromData, Pistol, FullyImplemented):
352+
"""
353+
Based on the Makarov PM
354+
"""
355+
356+
357+
class M1911(FromData, Pistol, FullyImplemented):
358+
"""
359+
Based on the M1911
360+
"""
361+
362+
363+
class StechkinAPS(FromData, Pistol, SelectiveFire, FullyImplemented):
364+
"""
365+
Based on the Stechkin automatic pistol (APS)
366+
"""
367+
368+
369+
class APS(FromData, Pistol, SelectiveFire, FullyImplemented):
370+
"""
371+
Based on the Stechkin automatic pistol (APS)
372+
"""
373+
374+
375+
class PPSh41(FromData, SMG, SelectiveFire, FullyImplemented):
376+
"""
377+
Based on the PPSh-41 (Shpagin machine pistol)
378+
"""
379+
380+
381+
class OwenSMG(FromData, SMG, FullyImplemented):
382+
"""
383+
Based on the Owen Machine Carbine (Australian)
384+
"""
385+
386+
387+
class AK47(FromData, Rifle, SelectiveFire, FullyImplemented):
388+
"""
389+
Based on the AK-47
390+
"""
391+
392+
393+
class HKG3(FromData, Rifle, SelectiveFire, FullyImplemented):
394+
"""
395+
Based on the Heckler & Koch G3
396+
"""
397+
398+
399+
class Jezail(FromData, Rifle, FullyImplemented):
400+
"""
401+
Based on the Jezail Musket. Does 2x dmg if user is on a mountain.
402+
https://en.wikipedia.org/wiki/Jezail
403+
"""
404+
405+
def __init__(self):
406+
super().__init__()
407+
self.player: Optional[Actors.PlayerCharacter] = None
408+
409+
def on_equip(self, player_character: Actors.PlayerCharacter):
410+
super().on_equip(player_character)
411+
self.player = player_character
412+
413+
def on_unequip(self, player_character: Actors.PlayerCharacter):
414+
super().on_unequip(player_character)
415+
self.player = None
416+
417+
def calc_damage(self, distance: int) -> int:
418+
damage = super().calc_damage(distance)
419+
if self.player and isinstance(
420+
self.player.location.terrain, GameSpace.MountainTerrain
421+
):
422+
damage *= 2
423+
return damage

Discordia/data/weapons.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@
88
"base_damage": 10,
99
"weight_lb": 2.4
1010
},
11+
"TT33": {
12+
"name": "TT-33 Pistol",
13+
"caliber": "IN_762",
14+
"action": "SemiAutomatic",
15+
"capacity": 8,
16+
"range_falloff": 0.4,
17+
"base_damage": 9,
18+
"weight_lb": 2.8
19+
},
20+
"Makarov": {
21+
"name": "Makarov PM",
22+
"caliber": "IN_762",
23+
"action": "SemiAutomatic",
24+
"capacity": 8,
25+
"range_falloff": 0.4,
26+
"base_damage": 9,
27+
"weight_lb": 2.8
28+
},
29+
"StechkinAPS": {
30+
"name": "Stechkin Automatic Pistol",
31+
"caliber": "MM_9",
32+
"action": "SemiAutomatic",
33+
"capacity": 20,
34+
"range_falloff": 0.7,
35+
"base_damage": 4,
36+
"weight_lb": 2.69
37+
},
1138
"M1911": {
1239
"name": "M1911 Pistol",
1340
"caliber": "IN_45",

0 commit comments

Comments
 (0)