mirror of
https://github.com/csd4ni3l/wizard_vs_irs.git
synced 2026-01-01 12:23:43 +01:00
Fix some issues when checking levels of weapons, update last tax evasion level, mostly game testing (ps: Why does hackatime think i did 20 mins?)
This commit is contained in:
31
game/play.py
31
game/play.py
@@ -1,8 +1,23 @@
|
|||||||
import arcade, arcade.gui, random, math, time, json, math
|
import arcade, arcade.gui, random, math, time, json, math
|
||||||
|
|
||||||
from utils.constants import BULLET_SPEED, HEALTH_INCREASE_PER_LEVEL, PLAYER_SPEED, IRS_AGENT_TYPES, ATTACK_INTERVAL_DECREASE_PER_LEVEL, ABILITIES
|
from utils.constants import (
|
||||||
from utils.constants import IRS_AGENT_SPAWN_INTERVAL, SPAWN_INTERVAL_DECREASE_PER_LEVEL, SPEED_INCREASE_PER_LEVEL, item_to_json_name
|
ABILITIES,
|
||||||
from utils.constants import TAX_EVASION_LEVELS, TAX_EVASION_NAMES, TAX_INCREASE_PER_LEVEL, menu_background_color, INVENTORY_ITEMS, INVENTORY_TRIGGER_KEYS, PLAYER_INACCURACY_MAX
|
ATTACK_INTERVAL_DECREASE_PER_LEVEL,
|
||||||
|
BULLET_SPEED,
|
||||||
|
HEALTH_INCREASE_PER_LEVEL,
|
||||||
|
INVENTORY_ITEMS,
|
||||||
|
INVENTORY_TRIGGER_KEYS,
|
||||||
|
IRS_AGENT_SPAWN_INTERVAL,
|
||||||
|
IRS_AGENT_TYPES,
|
||||||
|
item_to_json_name, # if it's a variable, better to keep original case
|
||||||
|
PLAYER_INACCURACY_MAX,
|
||||||
|
PLAYER_SPEED,
|
||||||
|
SPAWN_INTERVAL_DECREASE_PER_LEVEL,
|
||||||
|
SPEED_INCREASE_PER_LEVEL,
|
||||||
|
TAX_EVASION_LEVELS,
|
||||||
|
TAX_EVASION_NAMES,
|
||||||
|
TAX_INCREASE_PER_LEVEL,
|
||||||
|
)
|
||||||
|
|
||||||
import utils.preload
|
import utils.preload
|
||||||
from utils.preload import irs_agent_texture
|
from utils.preload import irs_agent_texture
|
||||||
@@ -138,7 +153,7 @@ anchor_x="right", anchor_y="bottom", align_x=-5)
|
|||||||
|
|
||||||
json_name = item_to_json_name[item_list[0]]
|
json_name = item_to_json_name[item_list[0]]
|
||||||
|
|
||||||
damage = item_list[2] + (item_list[2] / 10 * self.data["shop"][f"{json_name}_dmg"])
|
damage = item_list[2] + (item_list[2] / 10 * self.data["shop"].get(f"{json_name}_dmg", 0))
|
||||||
|
|
||||||
irs_agent.health -= damage
|
irs_agent.health -= damage
|
||||||
|
|
||||||
@@ -153,8 +168,8 @@ anchor_x="right", anchor_y="bottom", align_x=-5)
|
|||||||
self.camera_shake.start()
|
self.camera_shake.start()
|
||||||
|
|
||||||
def ability(self, ability):
|
def ability(self, ability):
|
||||||
if self.mana >= ABILITIES[ability][1] and time.perf_counter() - self.last_ability_timers.get(ability, 9999999999) <= ABILITIES[ability][0]:
|
if self.mana >= ABILITIES[ability]:
|
||||||
self.mana -= ABILITIES[ability][1]
|
self.mana -= ABILITIES[ability]
|
||||||
self.last_ability_timers[ability] = time.perf_counter()
|
self.last_ability_timers[ability] = time.perf_counter()
|
||||||
|
|
||||||
if ability == "dash":
|
if ability == "dash":
|
||||||
@@ -282,7 +297,7 @@ anchor_x="right", anchor_y="bottom", align_x=-5)
|
|||||||
|
|
||||||
json_name = item_to_json_name[item_list[0]]
|
json_name = item_to_json_name[item_list[0]]
|
||||||
|
|
||||||
if time.perf_counter() - self.last_shoot >= item_list[1] - ((item_list[1] / 15) * self.data["shop"][f"{json_name}_atk_speed"]):
|
if time.perf_counter() - self.last_shoot >= item_list[1] - ((item_list[1] / 15) * self.data["shop"].get(f"{json_name}_atk_speed", 0)):
|
||||||
self.last_shoot = time.perf_counter()
|
self.last_shoot = time.perf_counter()
|
||||||
|
|
||||||
mouse_pos = arcade.math.Vec2(
|
mouse_pos = arcade.math.Vec2(
|
||||||
@@ -344,7 +359,7 @@ anchor_x="right", anchor_y="bottom", align_x=-5)
|
|||||||
for irs_agent in self.irs_agents:
|
for irs_agent in self.irs_agents:
|
||||||
if arcade.math.Vec2(bullet.center_x, bullet.center_y).distance((irs_agent.center_x, irs_agent.center_y)) <= (irs_agent.width / 2 + bullet.radius):
|
if arcade.math.Vec2(bullet.center_x, bullet.center_y).distance((irs_agent.center_x, irs_agent.center_y)) <= (irs_agent.width / 2 + bullet.radius):
|
||||||
self.damage_irs_agent(irs_agent)
|
self.damage_irs_agent(irs_agent)
|
||||||
damage = item_list[2] + (item_list[2] / 10 * self.data["shop"][f"{json_name}_dmg"])
|
damage = item_list[2] + (item_list[2] / 10 * self.data["shop"].get(f"{json_name}_dmg", 0))
|
||||||
irs_agent.position += bullet.direction * damage * 1.5
|
irs_agent.position += bullet.direction * damage * 1.5
|
||||||
hit = True
|
hit = True
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ TAX_EVASION_LEVELS = {
|
|||||||
"International Watchlist": 125000,
|
"International Watchlist": 125000,
|
||||||
"Most Wanted": 250000,
|
"Most Wanted": 250000,
|
||||||
"Legendary": 500000,
|
"Legendary": 500000,
|
||||||
"Mythic": 1000000
|
"THE ONE AND ONLY TAX EVADER": 1000000
|
||||||
}
|
}
|
||||||
TAX_EVASION_NAMES = list(TAX_EVASION_LEVELS.keys())
|
TAX_EVASION_NAMES = list(TAX_EVASION_LEVELS.keys())
|
||||||
|
|
||||||
@@ -64,10 +64,10 @@ INVENTORY_ITEMS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
ABILITIES = {
|
ABILITIES = {
|
||||||
"dash": [5, 20],
|
"dash": 20,
|
||||||
"tax_shield": [15, 50],
|
"tax_shield": 50,
|
||||||
"audit_bomb": [20, 100],
|
"audit_bomb": 100,
|
||||||
"freeze_audit": [15, 150]
|
"freeze_audit": 150
|
||||||
}
|
}
|
||||||
|
|
||||||
item_to_json_name = {
|
item_to_json_name = {
|
||||||
|
|||||||
Reference in New Issue
Block a user