|
|
|
@ -328,7 +328,29 @@ void Monster::Draw(){ |
|
|
|
|
} |
|
|
|
|
void Monster::DrawReflection(float drawRatioX,float multiplierX){ |
|
|
|
|
game->SetDecalMode(DecalMode::ADDITIVE); |
|
|
|
|
game->view.DrawPartialRotatedDecal(GetPos()+vf2d{drawRatioX*GetFrame().GetSourceRect().size.x,GetZ()+(GetFrame().GetSourceRect().size.y-16)*GetSizeMult()},GetFrame().GetSourceImage()->Decal(),0,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,vf2d(GetSizeMult()*(GetFacingDirection()==RIGHT?-1:1)*multiplierX,GetSizeMult()*-1),GetBuffs(BuffType::SLOWDOWN).size()>0?Pixel{uint8_t(255*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration))),uint8_t(255*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration))),uint8_t(128+127*abs(sin(1.4*GetBuffs(BuffType::SLOWDOWN)[0].duration)))}:WHITE); |
|
|
|
|
|
|
|
|
|
vf2d defaultPos=GetPos()+vf2d{drawRatioX*GetFrame().GetSourceRect().size.x,GetZ()+(GetFrame().GetSourceRect().size.y-16)*GetSizeMult()}; |
|
|
|
|
vf2d spriteSize=GetFrame().GetSourceRect().size/1.5f*GetSizeMult(); |
|
|
|
|
|
|
|
|
|
float bottomExpansionAmount=abs(util::radToDeg(spriteRot))/10; |
|
|
|
|
|
|
|
|
|
//BL is in TR, BR is in TL, TR is in BL and TL is in BR.
|
|
|
|
|
std::array<vf2d,4>points={ |
|
|
|
|
vf2d{defaultPos+vf2d{-spriteSize.x/2,spriteSize.y}-vf2d{bottomExpansionAmount,0}}, //BL
|
|
|
|
|
vf2d{defaultPos-spriteSize.x/2}, //TL
|
|
|
|
|
vf2d{defaultPos+vf2d{spriteSize.x/2,-spriteSize.y/2}}, //TR
|
|
|
|
|
vf2d{defaultPos+spriteSize/2+vf2d{bottomExpansionAmount,0}}, //BR
|
|
|
|
|
}; |
|
|
|
|
if(GetFacingDirection()==RIGHT){ |
|
|
|
|
points={ |
|
|
|
|
vf2d{defaultPos+spriteSize/2+vf2d{bottomExpansionAmount,0}}, //BR
|
|
|
|
|
vf2d{defaultPos+vf2d{spriteSize.x/2,-spriteSize.y/2}}, //TR
|
|
|
|
|
vf2d{defaultPos-spriteSize.x/2}, //TL
|
|
|
|
|
vf2d{defaultPos+vf2d{-spriteSize.x/2,spriteSize.y}-vf2d{bottomExpansionAmount,0}}, //BL
|
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
game->view.DrawPartialWarpedDecal(GetFrame().GetSourceImage()->Decal(),points,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size); |
|
|
|
|
game->SetDecalMode(DecalMode::NORMAL); |
|
|
|
|
} |
|
|
|
|
void Monster::Collision(Player*p){ |
|
|
|
|