@ -41,16 +41,22 @@ All rights reserved.
# include "MonsterStrategyHelpers.h"
# include "util.h"
# include "Menu.h"
# include "Unlock.h"
# include "MenuComponent.h"
using A = Attribute ;
INCLUDE_game
INCLUDE_DATA
void Monster : : STRATEGY : : NPC ( Monster & m , float fElapsedTime , std : : string strategy ) {
if ( m . phase = = 0 ) { //Initialization.
if ( m . npcData . function . length ( ) > 0 ) {
m . SetStrategyDrawOverlayFunction ( [ ] ( AiL * game , Monster & m , const std : : string & strategy ) {
game - > KEY_CONFIRM . DrawInput ( m . GetPos ( ) + vf2d { ConfigFloatArr ( " Interaction Display Offset " , 0 ) , ConfigFloatArr ( " Interaction Display Offset " , 1 ) } , " Interact " , uint8_t ( util : : lerp ( 0.f , 255.f , m . F ( A : : TARGET_TIMER ) / ConfigFloat ( " Interaction Display Ease in Timer " ) ) ) ) ;
vf2d nameTextSize = game - > GetTextSizeProp ( m . GetName ( ) ) ;
uint8_t alpha = uint8_t ( util : : lerp ( 0.f , 255.f , m . F ( A : : TARGET_TIMER ) / ConfigFloat ( " Interaction Display Ease in Timer " ) ) ) ;
game - > view . DrawShadowStringPropDecal ( m . GetPos ( ) - vf2d { 0 , 12 } - nameTextSize / 2.f , m . GetName ( ) , { 255 , 255 , 0 } , { 0 , 0 , 0 } ) ;
game - > KEY_CONFIRM . DrawInput ( m . GetPos ( ) + vf2d { ConfigFloatArr ( " Interaction Display Offset " , 0 ) , ConfigFloatArr ( " Interaction Display Offset " , 1 ) } , " Interact " , alpha ) ;
} ) ;
}
m . phase = 1 ;
@ -63,7 +69,8 @@ void Monster::STRATEGY::NPC(Monster&m,float fElapsedTime,std::string strategy){
Menu : : OpenMenu ( MenuType : : BLACKSMITH ) ;
} else
if ( m . npcData . function = = " PotionCrafting " ) {
Menu : : OpenMenu ( MenuType : : CRAFT_CONSUMABLE ) ;
Menu : : OpenMenu ( MenuType : : SHERMAN ) ;
Component < MenuComponent > ( SHERMAN , " Consumable Crafting Button " ) - > SetGrayedOut ( ! Unlock : : IsUnlocked ( " NPCs.Sherman.Potion Crafting Unlock Condition " _S ) ) ;
} else
if ( m . npcData . function = = " TravelingMerchant " ) {
Menu : : OpenMenu ( MenuType : : MERCHANT ) ;