Skip to content

Commit

Permalink
Boost/Stun Ajustement
Browse files Browse the repository at this point in the history
  • Loading branch information
NotBlue-Dev committed Aug 26, 2021
1 parent cdaa5c1 commit 95444e5
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion assets/default.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"name":"goal","file":"goal.tact","intens":1,"dur":1,"state":true},{"name":"wall","file":"wall.tact","intens":1,"dur":1,"state":true},{"name":"grab","file":"grab.tact","intens":1,"dur":1,"state":true},{"name":"shield","file":"shield.tact","intens":1,"dur":1,"state":true},{"name":"stun","file":"stun.tact","intens":1,"dur":1,"state":true},{"name":"heart","file":"heart.tact","intens":1,"dur":1,"state":true},{"name":"boost","file":"boost.tact","intens":1,"dur":1,"state":false, "lock":true},{"name":"break","file":"break.tact","intens":1,"dur":1,"state":false, "lock":true},{"name":"stunned","file":"stunned.tact","intens":1,"dur":1,"state":false, "lock":true}]
[{"name":"goal","file":"goal.tact","intens":1,"dur":1,"state":true},{"name":"wall","file":"wall.tact","intens":1,"dur":1,"state":true},{"name":"grab","file":"grab.tact","intens":1,"dur":1,"state":true},{"name":"shield","file":"shield.tact","intens":1,"dur":1,"state":true},{"name":"stun","file":"stun.tact","intens":1,"dur":1,"state":true,"lock":false},{"name":"heart","file":"heart.tact","intens":1,"dur":1,"state":true},{"name":"boost","file":"boost.tact","intens":1,"dur":1,"state":true,"lock":false},{"name":"stunned","file":"stunned.tact","intens":1,"dur":1,"state":true,"lock":false}]
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"ip":"localhost","pseudo":"L-A-","files":[{"name":"goal","file":"goal.tact","intens":1,"dur":1,"state":true},{"name":"wall","file":"wall.tact","intens":1,"dur":1,"state":true},{"name":"grab","file":"grab.tact","intens":2,"dur":1,"state":true},{"name":"shield","file":"shield.tact","intens":1,"dur":1,"state":true},{"name":"stun","file":"stun.tact","intens":1,"dur":1,"state":false,"lock":true},{"name":"heart","file":"heart.tact","intens":4,"dur":1,"state":true},{"name":"boost","file":"boost.tact","intens":3,"dur":1,"state":false,"lock":true},{"name":"break","file":"break.tact","intens":1,"dur":1,"state":false,"lock":true},{"name":"stunned","file":"stunned.tact","intens":1,"dur":1,"state":true,"lock":false}]}
{"ip":"","pseudo":"","files":[{"name":"goal","file":"goal.tact","intens":1,"dur":1,"state":true},{"name":"wall","file":"wall.tact","intens":1,"dur":1,"state":true},{"name":"grab","file":"grab.tact","intens":1,"dur":1,"state":true},{"name":"shield","file":"shield.tact","intens":1,"dur":1,"state":true},{"name":"stun","file":"stun.tact","intens":1,"dur":1,"state":true,"lock":false},{"name":"heart","file":"heart.tact","intens":1,"dur":1,"state":true},{"name":"boost","file":"boost.tact","intens":1,"dur":1,"state":true,"lock":false},{"name":"stunned","file":"stunned.tact","intens":1,"dur":1,"state":true,"lock":false}]}
49 changes: 25 additions & 24 deletions js/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ let stunned = false;
let teamlen;
let lastVel = 0;
let block = false;
let boost = false;
let boost1 = false;
let boost2 = false;
let end = false;
let statuss;
let checks;
let tempVeloc;
let tempVelocMax;
let tempVelocMax = 24.95
let pyVeloc;
let Ti;

Expand All @@ -26,7 +27,8 @@ let optGrab = {intensity: config.files[config.files.findIndex(x=>x.name === 'gra
let optGoal = {intensity: config.files[config.files.findIndex(x=>x.name === 'goal')].intens, duration: config.files[config.files.findIndex(x=>x.name === 'goal')].dur}
let optShield = {intensity: config.files[config.files.findIndex(x=>x.name === 'shield')].intens, duration: config.files[config.files.findIndex(x=>x.name === 'shield')].dur}
let optWall = {intensity: config.files[config.files.findIndex(x=>x.name === 'wall')].intens, duration: config.files[config.files.findIndex(x=>x.name === 'wall')].dur}

let optBoost = {intensity: config.files[config.files.findIndex(x=>x.name === 'boost')].intens, duration: config.files[config.files.findIndex(x=>x.name === 'boost')].dur}
let optStun = {intensity: config.files[config.files.findIndex(x=>x.name === 'stun')].intens, duration: config.files[config.files.findIndex(x=>x.name === 'stun')].dur}


function playId() {
Expand Down Expand Up @@ -154,21 +156,21 @@ function request() {

//stun smone ? #Broken#

if(options.stun != true && stun == false) {
stun = true;
if(options.stun == true && stun == false) {
playerPos = resp.data.teams[team].players[index].head.position
for(let i in resp.data.teams[Ti].players) {
EnemyPos = resp.data.teams[Ti].players[i].head.position
if((playerPos[0] >= EnemyPos[0]-1 && playerPos[0] <= EnemyPos[0]+1) && (playerPos[1] >= EnemyPos[1]-1 && playerPos[1] <= EnemyPos[1]+1) && (playerPos[2] >= EnemyPos[2]-1 && playerPos[2] <= EnemyPos[2]+1)) {
if(resp.data.teams[Ti].players[i].stunned) {
console.log('STUN')
stun = true;
tactJs.default.submitRegisteredWithScaleOption('stun', optStun);
setTimeout(() => {
stun = false;
}, 1000);
}
}
}
setTimeout(() => {
stun = false;
}, 1000);
// tactJs.default.submitRegisteredWithScaleOption('stun');
}

//hit a wall ?
Expand All @@ -185,23 +187,23 @@ function request() {

//Boost 6.56 24.95

if (tempVeloc > 25) tempVeloc = 25

if(!(pyVeloc >= 25) && (pyVeloc >= tempVeloc -0.12 && pyVeloc <= tempVeloc +0.12) && boost == false) {
boost = true;
console.log('boost 1 ')
setTimeout(() => {
boost = false;
}, 1100);
}
if (tempVeloc > 25) tempVeloc = 24.94
if (tempVelocMax > 25) tempVeloc = 24.94

if(!(pyVeloc >= 25) && (pyVeloc >= tempVelocMax -0.12 && pyVeloc <= tempVelocMax +0.12) && boost == false) {
boost = true;
console.log('boost 2 ')
if(!(pyVeloc >= 24.94) && (pyVeloc >= tempVeloc -0.12 && pyVeloc <= tempVeloc +0.12) && boost1 == false) {
boost1 = true;
tactJs.default.submitRegisteredWithScaleOption('boost', optBoost);
setTimeout(() => {
boost = false;
boost1 = false;
}, 1000);
}

if((pyVeloc >= tempVelocMax -0.12 && pyVeloc <= tempVelocMax +0.12) && boost2 == false) {
boost2 = true;
tactJs.default.submitRegisteredWithScaleOption('boost', optBoost);

}
if(pyVeloc < 24.94) boost2 = false;
}

request() //restart request
Expand Down Expand Up @@ -231,5 +233,4 @@ function request() {

setInterval(() => {
tempVeloc = pyVeloc + 6.56
tempVelocMax = pyVeloc + 18.37
}, 1200)
}, 50)
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ function createWindow () {
title:'haptic',
})
mainWindow.loadFile('./view/main/index.html')
// Uncomment for Dev Version
mainWindow.webContents.openDevTools()
// comment for prod Version
//mainWindow.webContents.openDevTools()

}

Expand Down
2 changes: 1 addition & 1 deletion view/settings/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ span {
display: flex;
margin: 5px 25px;
align-items: center;
margin-bottom: 20px;
margin-bottom: 30px;
justify-content: space-between;
}

Expand Down

0 comments on commit 95444e5

Please sign in to comment.