Moved lower zone of stage 1-1 further left so items landing on the cliff edge are considered on the upper level. Fixed ability/item cast cancelling bug so interrupts properly occur.
This commit is contained in:
parent
852bbbc5a0
commit
b81058e296
@ -260,7 +260,9 @@ void Player::Update(float fElapsedTime){
|
|||||||
if(castInfo.castTimer>0){
|
if(castInfo.castTimer>0){
|
||||||
castInfo.castTimer-=fElapsedTime;
|
castInfo.castTimer-=fElapsedTime;
|
||||||
if(castInfo.castTimer<=0){
|
if(castInfo.castTimer<=0){
|
||||||
if(castPrepAbility->action(this,castInfo.castPos)){
|
bool allowed=castPrepAbility->actionPerformedDuringCast;
|
||||||
|
if(!allowed&&castPrepAbility->action(this,castInfo.castPos))allowed=true;
|
||||||
|
if(allowed){
|
||||||
castPrepAbility->cooldown=castPrepAbility->COOLDOWN_TIME;
|
castPrepAbility->cooldown=castPrepAbility->COOLDOWN_TIME;
|
||||||
ConsumeMana(castPrepAbility->manaCost);
|
ConsumeMana(castPrepAbility->manaCost);
|
||||||
}
|
}
|
||||||
@ -438,13 +440,11 @@ void Player::Update(float fElapsedTime){
|
|||||||
if(CanAct(ability)){
|
if(CanAct(ability)){
|
||||||
if(ability.cooldown==0&&GetMana()>=ability.manaCost){
|
if(ability.cooldown==0&&GetMana()>=ability.manaCost){
|
||||||
if(key.Held()||key.Released()&&&ability==castPrepAbility&&GetState()==State::PREP_CAST){
|
if(key.Held()||key.Released()&&&ability==castPrepAbility&&GetState()==State::PREP_CAST){
|
||||||
if(AllowedToCast(ability)){
|
if(AllowedToCast(ability)&&ability.action(this,{})){
|
||||||
bool allowed=ability.actionPerformedDuringCast;
|
bool allowed=ability.actionPerformedDuringCast;
|
||||||
if(!allowed&&ability.action(this,{}))allowed=true;
|
ability.cooldown=ability.COOLDOWN_TIME;
|
||||||
if(allowed){
|
CancelCast();
|
||||||
ability.cooldown=ability.COOLDOWN_TIME;
|
ConsumeMana(ability.manaCost);
|
||||||
ConsumeMana(ability.manaCost);
|
|
||||||
}
|
|
||||||
}else
|
}else
|
||||||
if(ability.precastInfo.precastTargetingRequired&&GetState()==State::NORMAL){
|
if(ability.precastInfo.precastTargetingRequired&&GetState()==State::NORMAL){
|
||||||
PrepareCast(ability);
|
PrepareCast(ability);
|
||||||
@ -654,13 +654,17 @@ Key Player::GetFacingDirection(){
|
|||||||
return facingDirection;
|
return facingDirection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Player::CancelCast(){
|
||||||
|
castInfo={"",0};
|
||||||
|
std::erase_if(buffList,[](Buff&b){return b.type==RESTORATION_DURING_CAST;}); //Remove all buffs that would be applied during a cast, as we got interrupted.
|
||||||
|
DAMAGENUMBER_LIST.push_back(std::make_shared<DamageNumber>(GetPos(),0,true,INTERRUPT));
|
||||||
|
}
|
||||||
|
|
||||||
void Player::Moved(){
|
void Player::Moved(){
|
||||||
if(state==State::CASTING){
|
if(state==State::CASTING){
|
||||||
state=State::NORMAL;
|
state=State::NORMAL;
|
||||||
castPrepAbility->waitForRelease=true;
|
castPrepAbility->waitForRelease=true;
|
||||||
castInfo={"",0};
|
CancelCast();
|
||||||
std::erase_if(buffList,[](Buff&b){return b.type==RESTORATION_DURING_CAST;}); //Remove all buffs that would be applied during a cast, as we got interrupted.
|
|
||||||
DAMAGENUMBER_LIST.push_back(std::make_shared<DamageNumber>(GetPos(),0,true,INTERRUPT));
|
|
||||||
}
|
}
|
||||||
for(MonsterSpawner&spawner:SPAWNER_LIST){
|
for(MonsterSpawner&spawner:SPAWNER_LIST){
|
||||||
if(!spawner.SpawnTriggered()&&spawner.DoesUpperLevelSpawning()==OnUpperLevel()&&geom2d::contains(geom2d::rect<float>{spawner.GetPos(),spawner.GetRange()},pos)){
|
if(!spawner.SpawnTriggered()&&spawner.DoesUpperLevelSpawning()==OnUpperLevel()&&geom2d::contains(geom2d::rect<float>{spawner.GetPos(),spawner.GetRange()},pos)){
|
||||||
|
|||||||
@ -259,6 +259,8 @@ public:
|
|||||||
static void AddMoneyListener(MenuComponent*component);
|
static void AddMoneyListener(MenuComponent*component);
|
||||||
uint32_t GetMoney()const;
|
uint32_t GetMoney()const;
|
||||||
void SetMoney(uint32_t newMoney);
|
void SetMoney(uint32_t newMoney);
|
||||||
|
|
||||||
|
void CancelCast();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Warrior:Player{
|
struct Warrior:Player{
|
||||||
|
|||||||
@ -39,7 +39,7 @@ All rights reserved.
|
|||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 2
|
#define VERSION_MINOR 2
|
||||||
#define VERSION_PATCH 1
|
#define VERSION_PATCH 1
|
||||||
#define VERSION_BUILD 4534
|
#define VERSION_BUILD 4538
|
||||||
|
|
||||||
#define stringify(a) stringify_(a)
|
#define stringify(a) stringify_(a)
|
||||||
#define stringify_(a) #a
|
#define stringify_(a) #a
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="205" height="205" tilewidth="24" tileheight="24" infinite="0" backgroundcolor="#475500" nextlayerid="9" nextobjectid="143">
|
<map version="1.10" tiledversion="1.10.1" class="Map" orientation="orthogonal" renderorder="right-down" width="205" height="205" tilewidth="24" tileheight="24" infinite="0" backgroundcolor="#475500" nextlayerid="9" nextobjectid="144">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
|
<property name="Level Type" propertytype="LevelType" value="Dungeon"/>
|
||||||
</properties>
|
</properties>
|
||||||
@ -1261,10 +1261,10 @@
|
|||||||
</data>
|
</data>
|
||||||
</layer>
|
</layer>
|
||||||
<objectgroup id="6" name="Transition Layer">
|
<objectgroup id="6" name="Transition Layer">
|
||||||
<object id="113" name="Lower Zone" type="LowerZone" x="1998" y="1950" width="402" height="894"/>
|
<object id="113" name="Lower Zone" type="LowerZone" x="1998" y="2172" width="378" height="672"/>
|
||||||
<object id="116" name="Upper Zone" type="UpperZone" x="2406" y="2448" width="978" height="324"/>
|
<object id="116" name="Upper Zone" type="UpperZone" x="2376" y="2472" width="1008" height="300"/>
|
||||||
<object id="118" name="Upper Zone" type="UpperZone" x="2400" y="1692" width="984" height="600"/>
|
<object id="118" name="Upper Zone" type="UpperZone" x="2376" y="1692" width="1008" height="660"/>
|
||||||
<object id="119" name="Upper Zone" type="UpperZone" x="2472" y="2292" width="912" height="156"/>
|
<object id="119" name="Upper Zone" type="UpperZone" x="2424" y="2292" width="960" height="180"/>
|
||||||
<object id="120" type="LowerBridgeCollision" x="3384" y="2232" width="24" height="144"/>
|
<object id="120" type="LowerBridgeCollision" x="3384" y="2232" width="24" height="144"/>
|
||||||
<object id="122" type="LowerBridgeCollision" x="4032" y="2232" width="24" height="144"/>
|
<object id="122" type="LowerBridgeCollision" x="4032" y="2232" width="24" height="144"/>
|
||||||
<object id="123" name="Upper Zone" type="UpperZone" x="4056" y="1938" width="816" height="780"/>
|
<object id="123" name="Upper Zone" type="UpperZone" x="4056" y="1938" width="816" height="780"/>
|
||||||
@ -1274,6 +1274,7 @@
|
|||||||
<property name="Upper?" type="bool" value="true"/>
|
<property name="Upper?" type="bool" value="true"/>
|
||||||
</properties>
|
</properties>
|
||||||
</object>
|
</object>
|
||||||
|
<object id="143" name="Lower Zone" type="LowerZone" x="2376" y="2376" width="48" height="72"/>
|
||||||
</objectgroup>
|
</objectgroup>
|
||||||
<objectgroup id="5" name="Spawn Groups">
|
<objectgroup id="5" name="Spawn Groups">
|
||||||
<object id="2" name="Spawn Group 1" type="SpawnGroup" x="870" y="4008" width="558.667" height="576">
|
<object id="2" name="Spawn Group 1" type="SpawnGroup" x="870" y="4008" width="558.667" height="576">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user