mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
pickup,punch btn is now bomb btn
This commit is contained in:
parent
f75653cdc4
commit
e3203684bb
1 changed files with 27 additions and 0 deletions
|
|
@ -30,6 +30,7 @@ class State:
|
||||||
self.next = None
|
self.next = None
|
||||||
self.index = None
|
self.index = None
|
||||||
|
|
||||||
|
|
||||||
def apply(self, spaz):
|
def apply(self, spaz):
|
||||||
spaz.disconnect_controls_from_player()
|
spaz.disconnect_controls_from_player()
|
||||||
spaz.connect_controls_to_player(enable_punch=self.punch,
|
spaz.connect_controls_to_player(enable_punch=self.punch,
|
||||||
|
|
@ -154,6 +155,19 @@ class ArmsRaceGame(ba.TeamGameActivity[Player, Team]):
|
||||||
player.state = self.states[0]
|
player.state = self.states[0]
|
||||||
self.spawn_player(player)
|
self.spawn_player(player)
|
||||||
|
|
||||||
|
def idk(self,spaz:PlayerSpaz):
|
||||||
|
|
||||||
|
return {"press":{
|
||||||
|
ba.InputType.PUNCH_PRESS : spaz.on_punch_press,
|
||||||
|
ba.InputType.PICK_UP_PRESS : spaz.on_pickup_press,},
|
||||||
|
"release":{
|
||||||
|
ba.InputType.PUNCH_RELEASE : spaz.on_punch_release,
|
||||||
|
ba.InputType.PICK_UP_RELEASE : spaz.on_pickup_release}
|
||||||
|
}
|
||||||
|
|
||||||
|
def set_controls(self,spaz:PlayerSpaz,):
|
||||||
|
spaz.on_punch_press()
|
||||||
|
|
||||||
# overriding the default character spawning..
|
# overriding the default character spawning..
|
||||||
def spawn_player(self, player):
|
def spawn_player(self, player):
|
||||||
if player.state is None:
|
if player.state is None:
|
||||||
|
|
@ -161,6 +175,19 @@ class ArmsRaceGame(ba.TeamGameActivity[Player, Team]):
|
||||||
super().spawn_player(player)
|
super().spawn_player(player)
|
||||||
player.state.apply(player.actor)
|
player.state.apply(player.actor)
|
||||||
|
|
||||||
|
press_input=self.idk(player.actor)["press"]
|
||||||
|
release_input=self.idk(player.actor)["release"]
|
||||||
|
|
||||||
|
for press,release in zip(press_input.keys(),release_input.keys()):
|
||||||
|
player.assigninput(
|
||||||
|
press,
|
||||||
|
lambda : player.actor.on_bomb_press()
|
||||||
|
)
|
||||||
|
player.assigninput(
|
||||||
|
release,
|
||||||
|
lambda: player.actor.on_bomb_release()
|
||||||
|
)
|
||||||
|
|
||||||
def isValidKill(self, m):
|
def isValidKill(self, m):
|
||||||
if m.getkillerplayer(Player) is None:
|
if m.getkillerplayer(Player) is None:
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue