加布林鲨鱼和牛角鱼的被动 */
| 259 | 加布林鲨鱼和牛角鱼的被动 |
| 260 | */ |
| 261 | std::optional<Json::Value> Fish::attack(Fish* target) { |
| 262 | //int dmg = atk / 2; |
| 263 | int dmg; |
| 264 | if((id == Fish::goblinshark) && hp * 5 < max_hp) dmg = (atk + 15) / 2; |
| 265 | else dmg = atk / 2; |
| 266 | assert(hostile != nullptr); |
| 267 | Fish* src = original ? original : this; |
| 268 | |
| 269 | J json = hostile->on_damaged(src, target, dmg).value(); |
| 270 | std::vector<Fish*> targets; |
| 271 | targets.clear(); |
| 272 | targets.push_back(target); |
| 273 | json["skill"] = skill_to_json("normalattack", targets, hostile->player_id, dmg, 0); |
| 274 | return json; |
| 275 | } |
| 276 | |
| 277 | std::optional<Json::Value> Fish::skill(std::vector<Fish*> my_list, std::vector<Fish*> enemy_list) { |
| 278 | return nullopt; |
no test coverage detected