Disable shooting with spawn protection, lower default spawn protection
This commit is contained in:
parent
e0fd2cf804
commit
d28ba31d74
@ -15,7 +15,7 @@ impl Default for GameOptions {
|
||||
opts.insert(GameOption::FriendlyFire, GameOptionValue::Boolean(true));
|
||||
opts.insert(GameOption::GoalsNeededToWin, GameOptionValue::Number(5.));
|
||||
opts.insert(GameOption::RespawnTimer, GameOptionValue::Number(5.));
|
||||
opts.insert(GameOption::SpawnProtection, GameOptionValue::Number(5.));
|
||||
opts.insert(GameOption::SpawnProtection, GameOptionValue::Number(3.));
|
||||
opts.insert(
|
||||
GameOption::TelegrenadesAllowed,
|
||||
GameOptionValue::Boolean(true),
|
||||
|
||||
@ -45,6 +45,15 @@ impl Buffs {
|
||||
true
|
||||
}
|
||||
|
||||
pub fn can_shoot(&self) -> bool {
|
||||
for buff in &self.buffs {
|
||||
match buff.kind {
|
||||
BuffKind::SpawnProtection => return false,
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
pub fn new_buff(&mut self, buff: Buff) {
|
||||
self.buffs.push(buff);
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ impl IPlayer for LocalPlayer {
|
||||
}
|
||||
|
||||
fn try_shoot(&mut self, to: Vector3, deal_damage: bool) -> bool {
|
||||
if self.try_shoot_common(to, deal_damage) {
|
||||
if self.buffs.can_shoot() && self.try_shoot_common(to, deal_damage) {
|
||||
if let Some(weapon) = &mut self.weapon {
|
||||
weapon.set_position(-Vector3::FORWARD);
|
||||
weapon.set_rotation(Vector3::RIGHT * 0.5);
|
||||
|
||||
@ -148,7 +148,11 @@ impl IPlayer for RemotePlayer {
|
||||
}
|
||||
|
||||
fn try_shoot(&mut self, to: Vector3, deal_damage: bool) -> bool {
|
||||
self.try_shoot_common(to, deal_damage)
|
||||
if self.buffs.can_shoot() {
|
||||
self.try_shoot_common(to, deal_damage)
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
fn try_throw_telegrenade(&mut self, to: Vector3) -> bool {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user