-
Notifications
You must be signed in to change notification settings - Fork 558
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
Supercrewmate interaction fixes #918
Open
AllyTally
wants to merge
10
commits into
TerryCavanagh:master
Choose a base branch
from
AllyTally:supercrewmate-fixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0c4a9b5
Allow supercrewmates to interact with gravity lines and gravity tokens
AllyTally 066f67b
make conveyors and horizontal platforms work
AllyTally 42f7cb9
apply velocity to player/scm, not line
AllyTally d82c089
Fix oneways with supercrewmates
AllyTally 24c13bd
Add INBOUNDS_VEC checks
AllyTally 3c99544
Fix a little bit of formatting
AllyTally a628b7a
Remove old TODO comment
AllyTally 7ee297e
unbreak moving platforms
AllyTally 2ec273a
Only adjust tile of SCMs, not all crewmates
AllyTally 89b7df8
Missed another part where it mattered
AllyTally File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -1483,6 +1483,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int | |||||||
entity.para = meta2; | ||||||||
entity.onentity = 1; | ||||||||
entity.animate = 100; | ||||||||
entity.scm = false; | ||||||||
break; | ||||||||
case 6: //Decorative particles | ||||||||
entity.rule = 2; | ||||||||
|
@@ -1572,6 +1573,7 @@ void entityclass::createentity(int xp, int yp, int t, int meta1, int meta2, int | |||||||
entity.life = 0; | ||||||||
entity.w = 1; | ||||||||
entity.h = meta1; | ||||||||
entity.scm = false; | ||||||||
//entity.colour = 0; | ||||||||
entity.onentity = 1; | ||||||||
break; | ||||||||
|
@@ -2628,8 +2630,26 @@ bool entityclass::updateentities( int i ) | |||||||
//wait for collision | ||||||||
if (entities[i].state == 1) | ||||||||
{ | ||||||||
game.gravitycontrol = (game.gravitycontrol + 1) % 2; | ||||||||
++game.totalflips; | ||||||||
if (entities[i].scm) | ||||||||
{ | ||||||||
int scm = getscm(); | ||||||||
if (INBOUNDS_VEC(scm, entities)) | ||||||||
{ | ||||||||
if (entities[scm].rule == 6) | ||||||||
{ | ||||||||
entities[scm].rule = 7; | ||||||||
} | ||||||||
else | ||||||||
{ | ||||||||
entities[scm].rule = 6; | ||||||||
} | ||||||||
} | ||||||||
} | ||||||||
else | ||||||||
{ | ||||||||
game.gravitycontrol = (game.gravitycontrol + 1) % 2; | ||||||||
++game.totalflips; | ||||||||
} | ||||||||
return disableentity(i); | ||||||||
|
||||||||
} | ||||||||
|
@@ -2745,18 +2765,42 @@ bool entityclass::updateentities( int i ) | |||||||
entities[i].onentity = 3; | ||||||||
entities[i].state = 2; | ||||||||
|
||||||||
|
||||||||
music.playef(8); | ||||||||
game.gravitycontrol = (game.gravitycontrol + 1) % 2; | ||||||||
game.totalflips++; | ||||||||
int temp = getplayer(); | ||||||||
if (game.gravitycontrol == 0) | ||||||||
|
||||||||
bool flipped = (game.gravitycontrol != 0); | ||||||||
|
||||||||
int entity = getplayer(); | ||||||||
|
||||||||
if (entities[i].para == 1) | ||||||||
{ | ||||||||
if (INBOUNDS_VEC(temp, entities) && entities[temp].vy < 3) entities[temp].vy = 3; | ||||||||
entity = getscm(); | ||||||||
if (INBOUNDS_VEC(entity, entities)) | ||||||||
{ | ||||||||
if (entities[entity].rule == 6) | ||||||||
{ | ||||||||
flipped = false; | ||||||||
entities[entity].rule = 7; | ||||||||
} | ||||||||
else | ||||||||
{ | ||||||||
flipped = true; | ||||||||
entities[entity].rule = 6; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
} | ||||||||
} | ||||||||
} | ||||||||
else | ||||||||
{ | ||||||||
if (INBOUNDS_VEC(temp, entities) && entities[temp].vy > -3) entities[temp].vy = -3; | ||||||||
game.gravitycontrol = (game.gravitycontrol + 1) % 2; | ||||||||
game.totalflips++; | ||||||||
} | ||||||||
|
||||||||
if (flipped) | ||||||||
{ | ||||||||
if (INBOUNDS_VEC(entity, entities) && entities[entity].vy < 3) entities[entity].vy = 3; | ||||||||
} | ||||||||
else | ||||||||
{ | ||||||||
if (INBOUNDS_VEC(entity, entities) && entities[entity].vy > -3) entities[entity].vy = -3; | ||||||||
} | ||||||||
} | ||||||||
else if (entities[i].state == 2) | ||||||||
|
@@ -3686,45 +3730,47 @@ void entityclass::animateentities( int _i ) | |||||||
case 55: | ||||||||
case 14: //Crew member! Very similar to hero | ||||||||
entities[_i].framedelay--; | ||||||||
if(entities[_i].dir==1) | ||||||||
if (entities[_i].dir == 1) | ||||||||
{ | ||||||||
entities[_i].drawframe=entities[_i].tile; | ||||||||
entities[_i].drawframe = entities[_i].tile; | ||||||||
} | ||||||||
else | ||||||||
{ | ||||||||
entities[_i].drawframe=entities[_i].tile+3; | ||||||||
entities[_i].drawframe = entities[_i].tile+3; | ||||||||
} | ||||||||
|
||||||||
if(entities[_i].visualonground>0 || entities[_i].visualonroof>0) | ||||||||
if (entities[_i].visualonground > 0 || entities[_i].visualonroof > 0) | ||||||||
{ | ||||||||
if(entities[_i].vx > 0.0000f || entities[_i].vx < -0.000f) | ||||||||
{ | ||||||||
//Walking | ||||||||
if(entities[_i].framedelay<=0) | ||||||||
if(entities[_i].framedelay <= 0) | ||||||||
{ | ||||||||
entities[_i].framedelay=4; | ||||||||
entities[_i].framedelay = 4; | ||||||||
entities[_i].walkingframe++; | ||||||||
} | ||||||||
if (entities[_i].walkingframe >=2) entities[_i].walkingframe=0; | ||||||||
if (entities[_i].walkingframe >= 2) entities[_i].walkingframe = 0; | ||||||||
entities[_i].drawframe += entities[_i].walkingframe + 1; | ||||||||
} | ||||||||
|
||||||||
//if (entities[_i].visualonroof > 0) entities[_i].drawframe += 6; | ||||||||
if (entities[_i].type == 14) | ||||||||
{ | ||||||||
if (entities[_i].visualonroof > 0) entities[_i].drawframe += 6; | ||||||||
} | ||||||||
} | ||||||||
else | ||||||||
{ | ||||||||
entities[_i].drawframe ++; | ||||||||
//if (game.gravitycontrol == 1) { | ||||||||
// entities[_i].drawframe += 6; | ||||||||
//} | ||||||||
entities[_i].drawframe++; | ||||||||
if (entities[_i].rule == 7 && entities[_i].type == 14) { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
entities[_i].drawframe += 6; | ||||||||
} | ||||||||
} | ||||||||
|
||||||||
if (game.deathseq > -1) | ||||||||
{ | ||||||||
entities[_i].drawframe=13; | ||||||||
entities[_i].drawframe = 13; | ||||||||
if (entities[_i].dir == 1) entities[_i].drawframe = 12; | ||||||||
if (entities[_i].rule == 7) entities[_i].drawframe += 2; | ||||||||
//if (game.gravitycontrol == 1) entities[_i].drawframe += 2; | ||||||||
} | ||||||||
break; | ||||||||
case 100: //the teleporter! | ||||||||
|
@@ -4444,7 +4490,7 @@ bool entityclass::testwallsx( int t, int tx, int ty, const bool skipdirblocks ) | |||||||
bool skipblocks = entities[t].rule < 2 || entities[t].type == 14; | ||||||||
float dx = 0; | ||||||||
float dy = 0; | ||||||||
if (entities[t].rule == 0) dx = entities[t].vx; | ||||||||
if (entities[t].rule == 0 || entities[t].type == 14) dx = entities[t].vx; | ||||||||
int dr = entities[t].rule; | ||||||||
|
||||||||
const bool invincible = map.invincibility && entities[t].ishumanoid(); | ||||||||
|
@@ -4491,7 +4537,7 @@ bool entityclass::testwallsy( int t, int tx, int ty ) | |||||||
|
||||||||
float dx = 0; | ||||||||
float dy = 0; | ||||||||
if (entities[t].rule == 0) dy = entities[t].vy; | ||||||||
if (entities[t].rule == 0 || entities[t].type == 14) dy = entities[t].vy; | ||||||||
int dr = entities[t].rule; | ||||||||
|
||||||||
const bool invincible = map.invincibility && entities[t].ishumanoid(); | ||||||||
|
@@ -4818,7 +4864,10 @@ void entityclass::collisioncheck(int i, int j, bool scm /*= false*/) | |||||||
case 3: //Entity to entity | ||||||||
if(entities[j].onentity>0) | ||||||||
{ | ||||||||
if (entitycollide(i, j)) entities[j].state = entities[j].onentity; | ||||||||
if (entitycollide(i, j)) { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
entities[j].state = entities[j].onentity; | ||||||||
entities[j].scm = scm; | ||||||||
} | ||||||||
} | ||||||||
break; | ||||||||
case 4: //Person vs horizontal line! | ||||||||
|
@@ -4831,9 +4880,27 @@ void entityclass::collisioncheck(int i, int j, bool scm /*= false*/) | |||||||
if (entityhlinecollide(i, j)) | ||||||||
{ | ||||||||
music.playef(8); | ||||||||
game.gravitycontrol = (game.gravitycontrol + 1) % 2; | ||||||||
game.totalflips++; | ||||||||
if (game.gravitycontrol == 0) | ||||||||
bool flipped = (game.gravitycontrol != 0); | ||||||||
if (scm) | ||||||||
{ | ||||||||
if (entities[i].rule == 6) | ||||||||
{ | ||||||||
flipped = false; | ||||||||
entities[i].rule = 7; | ||||||||
} | ||||||||
else | ||||||||
{ | ||||||||
flipped = true; | ||||||||
entities[i].rule = 6; | ||||||||
} | ||||||||
} | ||||||||
else | ||||||||
{ | ||||||||
game.gravitycontrol = (game.gravitycontrol + 1) % 2; | ||||||||
game.totalflips++; | ||||||||
} | ||||||||
|
||||||||
if (flipped) | ||||||||
{ | ||||||||
if (entities[i].vy < 1) entities[i].vy = 1; | ||||||||
} | ||||||||
|
@@ -4855,6 +4922,7 @@ void entityclass::collisioncheck(int i, int j, bool scm /*= false*/) | |||||||
{ | ||||||||
if (entityvlinecollide(i, j)) | ||||||||
{ | ||||||||
entities[j].scm = scm; | ||||||||
entities[j].state = entities[j].onentity; | ||||||||
entities[j].life = 4; | ||||||||
} | ||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.