Fixed missing operator= for the InputEngageGroup class. Add scaling damage number size based on relative damage multiplier. Release build 6264.
This commit is contained in:
parent
553baa5945
commit
b8da4fbbbe
@ -1351,7 +1351,7 @@ void AiL::RenderWorld(float fElapsedTime){
|
||||
case HEALTH_LOSS:{
|
||||
std::string text=std::to_string(dn->damage);
|
||||
if(!dn->friendly){
|
||||
view.DrawStringPropDecal(dn->pos-GetTextSizeProp(text)/2,text,DARK_RED);
|
||||
view.DrawStringPropDecal(dn->pos-GetTextSizeProp(text)/2.f*dn->size,text,DARK_RED,dn->size);
|
||||
}else{
|
||||
view.DrawShadowStringPropDecal(dn->pos-GetTextSizeProp(text)/2,text,RED,VERY_DARK_GREY);
|
||||
}
|
||||
@ -1379,7 +1379,7 @@ void AiL::RenderWorld(float fElapsedTime){
|
||||
case CRIT:{
|
||||
std::string text=std::to_string(dn->damage);
|
||||
if(!dn->friendly){
|
||||
view.DrawShadowStringPropDecal(dn->pos-GetTextSizeProp(text)/2,text,YELLOW,DARK_YELLOW);
|
||||
view.DrawShadowStringPropDecal(dn->pos-GetTextSizeProp(text)/2.f*dn->size,text,YELLOW,DARK_YELLOW,dn->size);
|
||||
}else{
|
||||
view.DrawStringPropDecal(dn->pos-GetTextSizeProp(text)/2,text,BLACK);
|
||||
}
|
||||
|
@ -83,7 +83,6 @@ struct ChargedArrow:public Bullet{
|
||||
struct FrogTongue:public Bullet{
|
||||
vf2d targetPos;
|
||||
float tongueLength;
|
||||
float tongueSpd;
|
||||
float duration;
|
||||
float knockbackStrength;
|
||||
FrogTongue(vf2d pos,vf2d targetPos,float lifetime,int damage,bool upperLevel,float knockbackStrength=1.0f,bool friendly=false,Pixel col=WHITE);
|
||||
|
@ -36,6 +36,9 @@ All rights reserved.
|
||||
*/
|
||||
#pragma endregion
|
||||
#include "DamageNumber.h"
|
||||
#include "AdventuresInLestoria.h"
|
||||
|
||||
INCLUDE_game
|
||||
|
||||
const float DamageNumber::MOVE_UP_TIME=0.4f;
|
||||
|
||||
@ -46,4 +49,18 @@ DamageNumber::DamageNumber()
|
||||
DamageNumber::DamageNumber(vf2d pos,int damage,bool friendly,DamageNumberType type):
|
||||
pos(pos),damage(damage),friendly(friendly),type(type),invertedDirection(type==INTERRUPT),riseSpd(20.f){
|
||||
if(type==INTERRUPT||type==MANA_GAIN)riseSpd=40.f;
|
||||
originalRiseSpd=riseSpd;
|
||||
RecalculateSize();
|
||||
}
|
||||
|
||||
void DamageNumber::RecalculateSize(){
|
||||
float damageMultRatio=damage/game->GetPlayer()->GetBaseStat("Attack")/2.f;
|
||||
riseSpd=originalRiseSpd;
|
||||
if(!friendly){
|
||||
float newSize=std::clamp(round(damageMultRatio),1.0f,4.0f);
|
||||
|
||||
if(type==HEALTH_LOSS||type==CRIT)riseSpd*=newSize;
|
||||
|
||||
size=vf2d{newSize,newSize};
|
||||
}
|
||||
}
|
@ -52,10 +52,13 @@ struct DamageNumber{
|
||||
float lifeTime=0;
|
||||
float pauseTime=0;
|
||||
float riseSpd=0.f;
|
||||
vf2d size{1.f,1.f};
|
||||
bool friendly=false;
|
||||
bool invertedDirection=false;
|
||||
DamageNumberType type=HEALTH_LOSS;
|
||||
const static float MOVE_UP_TIME;
|
||||
float originalRiseSpd=0.f;
|
||||
DamageNumber();
|
||||
DamageNumber(vf2d pos,int damage,bool friendly=false,DamageNumberType type=HEALTH_LOSS);
|
||||
void RecalculateSize();
|
||||
};
|
@ -45,7 +45,7 @@ INCLUDE_MONSTER_LIST
|
||||
INCLUDE_GFX
|
||||
|
||||
FrogTongue::FrogTongue(vf2d pos,vf2d targetPos,float lifetime,int damage,bool upperLevel,float knockbackStrength,bool friendly,Pixel col)
|
||||
:Bullet(pos,{},0,damage,upperLevel,friendly,col),targetPos(targetPos),tongueSpd(tongueSpd),tongueLength(0.f),knockbackStrength(knockbackStrength){
|
||||
:Bullet(pos,{},0,damage,upperLevel,friendly,col),targetPos(targetPos),tongueLength(0.f),knockbackStrength(knockbackStrength){
|
||||
this->lifetime=lifetime;
|
||||
duration=lifetime;
|
||||
}
|
||||
|
@ -463,4 +463,8 @@ const InputEngageGroup::EngageType InputEngageGroup::GetEngageType()const{
|
||||
|
||||
InputGroup&InputEngageGroup::GetGroup()const{
|
||||
return group;
|
||||
}
|
||||
|
||||
const InputEngageGroup InputEngageGroup::operator=(const InputEngageGroup&rhs){
|
||||
return InputEngageGroup{rhs.group,rhs.type};
|
||||
}
|
@ -107,6 +107,7 @@ public:
|
||||
InputEngageGroup(InputGroup&group,EngageType type=Released);
|
||||
const EngageType GetEngageType()const;
|
||||
InputGroup&GetGroup()const;
|
||||
const InputEngageGroup operator=(const InputEngageGroup&rhs);
|
||||
};
|
||||
|
||||
class GenericKey{
|
||||
|
@ -440,6 +440,7 @@ bool Monster::Hurt(int damage,bool onUpperLevel,float z){
|
||||
if(lastHitTimer>0){
|
||||
damageNumberPtr.get()->damage+=int(mod_dmg);
|
||||
damageNumberPtr.get()->pauseTime=0.4f;
|
||||
damageNumberPtr.get()->RecalculateSize();
|
||||
} else {
|
||||
damageNumberPtr=std::make_shared<DamageNumber>(pos,int(mod_dmg));
|
||||
DAMAGENUMBER_LIST.push_back(damageNumberPtr);
|
||||
|
@ -718,6 +718,7 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z){
|
||||
if(lastHitTimer>0){
|
||||
damageNumberPtr.get()->damage+=int(mod_dmg);
|
||||
damageNumberPtr.get()->pauseTime=0.4f;
|
||||
damageNumberPtr.get()->RecalculateSize();
|
||||
} else {
|
||||
damageNumberPtr=std::make_shared<DamageNumber>(pos,int(mod_dmg),true);
|
||||
DAMAGENUMBER_LIST.push_back(damageNumberPtr);
|
||||
|
@ -199,7 +199,7 @@ void State_OverworldMap::Draw(AiL*game){
|
||||
using AngleTotal=float;
|
||||
using Count=uint8_t;
|
||||
using MedianAngle=std::pair<AngleTotal,Count>;
|
||||
using ConnectionPointIndex=float;
|
||||
using ConnectionPointIndex=int;
|
||||
|
||||
auto GetAngle=[](MedianAngle angle){
|
||||
return angle.first/angle.second;
|
||||
|
@ -31,8 +31,6 @@ Story proofreading/correcting/storyboarding
|
||||
|
||||
- Add Death screen (Zoom in on fatal blow, slow time down... Display some game over text... Allow retry or return to world map.)
|
||||
|
||||
- Auto targeting for controller / keyboard.
|
||||
|
||||
A "Debug" version of the game that simply outputs all std::cout to a file as well (debug.log).
|
||||
ERR messages become just output messages in release build and won't crash the game.
|
||||
|
||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 6261
|
||||
#define VERSION_BUILD 6264
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
@ -78,7 +78,7 @@ bgm_config = audio/bgm.txt
|
||||
event_config = audio/events.txt
|
||||
|
||||
# Path to interface configuration
|
||||
interface_config = interface.txt
|
||||
interface_config = Interface.txt
|
||||
|
||||
# Path to character images
|
||||
character_image_location = characters/
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user