Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output gPlayerInfo via console #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion saliensHack.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@

if (gGame.m_State.m_VictoryScreen || gGame.m_State.m_LevelUpScreen) {
gGame.ChangeState( new CBattleSelectionState( gGame.m_State.m_PlanetData.id ) );
console.log('round done');
console.log('########## ROUND DONE ##########');
return;
}

Expand Down Expand Up @@ -139,7 +139,31 @@

var joinZone = function(zoneId) {
if (joiningZone) return;
console.log('--------------------------------');
console.log('-------------FIGHT--------------');
console.log('--------------------------------');
console.log('Joining zone:', zoneId);
console.log('Uncaptured Zones:', gGame.m_State.m_PlanetData.zones.length);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the total zones. You need to filter on the captured flag of the zone object.

gGame.m_State.m_PlanetData.zones.filter(function(zone) { return !zone.captured; }).length

console.log('--------------------------------');
console.log('LVL: ' + gPlayerInfo.level);
console.log('EXP: ' + gPlayerInfo.score + ' / ' + gPlayerInfo.next_level_score);
console.log('--------------------------------');
var need = gPlayerInfo.next_level_score - gPlayerInfo.score;
var zones = gGame.m_State.m_PlanetData.zones;
var dif = zones[zoneId].difficulty;
var score
if (dif === 1) { score = 600 }
if (dif === 2) { score = 1200 }
if (dif === 3) { score = 2400 }
var gamesn = need / score;
var lvlupm = gamesn * 2;
var lvluph = gamesn * 2 / 60;
var lvluphf = lvluph.toFixed(2);
console.log('Difficulty: ' + dif);
console.log('Games needed: ' + gamesn);
console.log('LVLUP minutes: ' + lvlupm);
console.log('LVLUP hours: ' + lvluphf);
console.log('--------------------------------');

joiningZone = true;

Expand Down