Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
etorth committed Nov 7, 2021
1 parent 147010e commit e78cd98
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/src/buffrecord.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
.time = 6000,
.gfxID = 0X18000083,
},

{ .name = u8"施毒术",
.tps = 2,
.time = 6000,
.gfxID = 0X18000074,
},
13 changes: 13 additions & 0 deletions server/src/battleobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,19 @@ void BattleObject::addBuff(uint32_t buffID)
}));
break;
}
case DBCOM_BUFFID(u8"施毒术"):
{
m_buffList.addBuff(std::unique_ptr<BaseBuff>(new PeriodicBuff
{
buffID,
this,
[this](PeriodicBuff *)
{
updateHealth(-5, {}, {}, {});
},
}));
break;
}
default:
{
break;
Expand Down
20 changes: 20 additions & 0 deletions server/src/monsterop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,26 @@ void Monster::on_AM_ADDBUFF(const ActorMsgPack &mpk)
}
}
});
break;
}
case DBCOM_BUFFID(u8"施毒术"):
{
checkFriend(amAB.from, [amAB, this](int friendType)
{
switch(friendType){
case FT_ENEMY:
case FT_NEUTRAL:
{
addBuff(DBCOM_BUFFID(u8"施毒术"));
return;
}
default:
{
return;
}
}
});
break;
}
default:
{
Expand Down
37 changes: 37 additions & 0 deletions server/src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,43 @@ void Player::onCMActionSpell(CMAction cmA)
}
break;
}
case DBCOM_MAGICID(u8"施毒术"):
{
if(cmA.action.aimUID){
switch(uidf::getUIDType(cmA.action.aimUID)){
case UID_MON:
case UID_PLY:
{
checkFriend(cmA.action.aimUID, [cmA, this](int friendType)
{
switch(friendType){
case FT_ENEMY:
case FT_NEUTRAL:
{
AMAddBuff amAB;
std::memset(&amAB, 0, sizeof(amAB));

amAB.id = DBCOM_BUFFID(u8"施毒术");
amAB.from = UID();
m_actorPod->forward(cmA.action.aimUID, {AM_ADDBUFF, amAB});
return;
}
default:
{
return;
}
}
});
break;
}
default:
{
break;
}
}
}
break;
}
case DBCOM_MAGICID(u8"火球术"):
case DBCOM_MAGICID(u8"大火球"):
case DBCOM_MAGICID(u8"灵魂火符"):
Expand Down
20 changes: 20 additions & 0 deletions server/src/playerop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,26 @@ void Player::on_AM_ADDBUFF(const ActorMsgPack &mpk)
}
}
});
break;
}
case DBCOM_BUFFID(u8"施毒术"):
{
checkFriend(amAB.from, [amAB, this](int friendType)
{
switch(friendType){
case FT_ENEMY:
case FT_NEUTRAL:
{
addBuff(DBCOM_BUFFID(u8"施毒术"));
return;
}
default:
{
return;
}
}
});
break;
}
default:
{
Expand Down

0 comments on commit e78cd98

Please sign in to comment.