Skip to content
This repository has been archived by the owner on Jul 17, 2018. It is now read-only.

Change skill logic. second try #93

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

TehDmitry
Copy link
Contributor

  • use meteor by cooldown in center-line
  • use blackhole in center-line
  • use bomb if enemy hp > 30
  • select more effective target for bomb
  • reduce enemy scoring if they will be affected by meteor

instead #84 (I ruined branch by rebase)

index.user.js Outdated
this.attack();
}
attack() {
SetMouse(k_nDamagePointx + 50, (APP.renderer.height / 2) + 100);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where does this 50 come from? Is it the size of the Meteor sprite?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@TehDmitry ping

Copy link
Contributor Author

Choose a reason for hiding this comment

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

k_nDamagePointx + 50 — is just little bit right from left side of screen

index.user.js Outdated
if (enemy.m_bDead || EnemyWillAffectedByBoulder(enemy) || BlackholeOfEnemy(enemy) != null)
return WORST_SCORE;

let score = AllEnemiesHPNearPoint(enemy.m_Sprite.x, enemy.m_Sprite.y, 50);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where does the 50 come from? Is it the size of the Projectile sprite?

index.user.js Outdated
}
const AllEnemiesHPNearPoint = function AllEnemiesHPNearPoint(x, y, radius) {
let hp = 0;
EnemyManager().m_rgEnemies.forEach((enemy) => {
Copy link
Collaborator

@EoD EoD Jun 24, 2018

Choose a reason for hiding this comment

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

I am not an expert on JS, but do you really want to execute a forEach here? Couldn't it be async and hence hp will always be 0?

Copy link
Owner

Choose a reason for hiding this comment

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

yes you do since m_rgEnemies is a Map object

Copy link
Collaborator

Choose a reason for hiding this comment

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

@meepen so it is guaranteed to not to be async? What about the following approach?

for(var [_, enemy] of EnemyManager().m_rgEnemies) {
        // If something
    hp += enemy.m_nHealth;
}

@TehDmitry
Copy link
Contributor Author

changed

index.user.js Outdated
@@ -402,7 +408,8 @@ class BombAttack extends ProjectileAttack {
if (enemy.m_bDead || EnemyWillAffectedByBoulder(enemy) || BlackholeOfEnemy(enemy) != null)
return WORST_SCORE;

let score = AllEnemiesHPNearPoint(enemy.m_Sprite.x, enemy.m_Sprite.y, 50);
let explosionWidth = GAME.m_State.m_AttackManager.m_rgExplosionFrames[0].width * 0.4; //attack.js:353 value is 204.8
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice find. Instead of * 0.4 you could use GAME.m_State.m_AttackManager.m_rgExplosionFrames[0].scale[1] can you not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

m_rgExplosionFrames[0] doesn't have the scale property:

console.log(gGame.m_State.m_AttackManager.m_rgExplosionFrames[0].scale)
undefined

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fair enough, you would need to get the AnimatedSprite. Let's Meepen decide.

				var explosion = new PIXI.extras.AnimatedSprite(instance.m_rgExplosionFrames );
				explosion.animationSpeed = 0.2;
				explosion.loop = false;
				explosion.play();
				explosion.scale.set( 0.4, 0.4 );
				explosion.anchor.set( 0.5, 0.5 );

index.user.js Outdated
const CenterOfSpawnZoneYpos = function CenterOfSpawnZoneX(enemy) {
//slime from enemies.json has scale 0.5
//texture has height 126
let minSpriteHeight = 126 * 0.5;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't you use enemy.m_Sprite.height here? Something similar for the scale?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

enemy is excess here, fixed

Copy link
Collaborator

Choose a reason for hiding this comment

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

@TehDmitry I am more worried about the 126 and the 0.5 here. Where are they coming from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://steamcdn-a.akamaihd.net/steamcommunity/public/assets//saliengame/enemies.json
"slime":{

"scale": {
"x":0.5,
"y":0.5
},

PIXI.loader.resources['enemy-spritesheet-0'].textures['Enemy_A_0007.png'].height
126

@TehDmitry
Copy link
Contributor Author

Is this changes enough?

@EoD
Copy link
Collaborator

EoD commented Jun 24, 2018

@TehDmitry we are getting there! Except for the magic numbers mentioned above, is there a reason why you are overloading attack() instead of targetPosition(target)?

@TehDmitry
Copy link
Contributor Author

@EoD because I don't have the target for Meteor and Blackhole attacks

@TehDmitry
Copy link
Contributor Author

@EricMue in this branch I don't change coordinates for bomb attack, only enemy scoring for finding best enemy group.
But you are right. Sometimes when black hole is active — bomb is missing

@EoD
Copy link
Collaborator

EoD commented Jun 25, 2018

@meepen what is your take on this?

@TehDmitry
Copy link
Contributor Author

I think we are making ideal code instead making fun

@Kefta
Copy link

Kefta commented Jun 26, 2018

ideal code is fun

@TehDmitry
Copy link
Contributor Author

I don't know what they want.
Without approving requests is no motivation to create them. For example I already have boss support

@meepen
Copy link
Owner

meepen commented Jun 30, 2018 via email

@TehDmitry
Copy link
Contributor Author

In next minigame I will try to be better.
But with 7-day-long PR reviews it's a little bit hard.

Bot is outdating too fast.
For example is any reason to use this ideal script without boss support instead not ideal but with support?
Maybe ideal support a month later will be better?

I will remind you only two days left for fun.
But #171 with most important feature is still open for 8 hour.

Seems to be too many enterprise-way for this fun game

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants