mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
trying to fix dangerousness and added a cheat script #72
This commit is contained in:
parent
4bf4eb8b35
commit
355282ca08
3 changed files with 17 additions and 3 deletions
|
|
@ -55,8 +55,9 @@ function (Parent, Item, Box2D, Nc) {
|
||||||
if(item.lastMoved && item.lastMoved.player != this.player) {
|
if(item.lastMoved && item.lastMoved.player != this.player) {
|
||||||
var damageVector = b2Math.SubtractVV(itemVelocity, ownVelocity);
|
var damageVector = b2Math.SubtractVV(itemVelocity, ownVelocity);
|
||||||
damageVector.Abs();
|
damageVector.Abs();
|
||||||
damageVector.Multiply(itemMass);
|
damageVector.Multiply(0.7);
|
||||||
var damage = damageVector.Length() * 2;
|
damageVector.Multiply(itemMass * 1.3);
|
||||||
|
var damage = damageVector.Length();
|
||||||
damage *= item.options.danger ? item.options.danger : 1;
|
damage *= item.options.danger ? item.options.danger : 1;
|
||||||
|
|
||||||
var player = item.lastMoved.player;
|
var player = item.lastMoved.player;
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ function (Parent, Nc) {
|
||||||
if(this.stats.health < 0) this.stats.health = 0;
|
if(this.stats.health < 0) this.stats.health = 0;
|
||||||
|
|
||||||
if(this.stats.health <= 0) {
|
if(this.stats.health <= 0) {
|
||||||
/*if(enemy != this) self killing scores for testing! */ enemy.score();
|
if(enemy != this) enemy.score();
|
||||||
this.kill(enemy);
|
this.kill(enemy);
|
||||||
} else {
|
} else {
|
||||||
this.broadcastStats();
|
this.broadcastStats();
|
||||||
|
|
|
||||||
13
snippets/cheats/flyOnE.js
Normal file
13
snippets/cheats/flyOnE.js
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
|
||||||
|
var kd = window.onkeydown;
|
||||||
|
window.onkeydown = function (e) {
|
||||||
|
if(e.keyCode != 69) {
|
||||||
|
kd(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var body = inspector.networker.gameController.me.doll.body
|
||||||
|
body.SetPosition({
|
||||||
|
x: body.GetPosition().x + 1,
|
||||||
|
y: body.GetPosition().y
|
||||||
|
})
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue