-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHalberd.cpp
More file actions
32 lines (28 loc) · 773 Bytes
/
Copy pathHalberd.cpp
File metadata and controls
32 lines (28 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "Lib.h"
#include "Halberd.h"
#include "PreUseStruct.h"
#include "Slash.h"
Halberd::Halberd() : WeaponCard("方天画戟",4)
{
}
vector<SkillEffect *> Halberd::getEquipSkill(Player *p)
{
return vector<SkillEffect *>(1,new HalberdSkill(p));
}
HalberdSkill::HalberdSkill(Player *p)
{
player=p;influence=maxTargetValue;
}
void HalberdSkill::apply(void *value, void *data)
{
int *v=(int*)value;
PreUseStruct *d=(PreUseStruct*)data;
if(d->player==player&&dynamic_cast<Slash*>(d->info.name)&&!d->cards.empty()&&!player->hand.size)
{
d->testMove->undo();
bool flag=true;
for(int i=0;i<d->cards.size();i++) if(d->cards[i]->zone!=&player->hand) flag=false;
d->testMove->happen();
if(flag) (*v)+=2;
}
}