mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-23 22:43:36 +00:00
embargo if attacked (#353)
## Responsibility Acknowledgment - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through basic manual testing: - Significantly slows down the entire development process - Blocks releases and new features for all contributors - Harms the project's reliability and reputation - Places additional debugging burden on maintainers who already have limited time - Diverts valuable resources away from new development and improvements - Makes me seen as a loser - Makes me more likely to go to hell
This commit is contained in:
@@ -81,6 +81,10 @@ export class AttackExecution implements Execution {
|
||||
? mg.terraNullius()
|
||||
: mg.player(this._targetID);
|
||||
|
||||
if (this.target && this.target.isPlayer()) {
|
||||
(this.target as Player).addEmbargo(this._owner.id());
|
||||
}
|
||||
|
||||
if (this._owner == this.target) {
|
||||
console.error(`Player ${this._owner} cannot attack itself`);
|
||||
this.active = false;
|
||||
|
||||
Reference in New Issue
Block a user