QtCraft API C++ classes QML types Handbook

QcFishingDefinition Struct

What a fishing rod does (decision E-503; "fishing" in the item's file): the use button casts bobber, a projectile kind, at speed and reels it in again. More...

Header: #include <common/content/items/QcProjectileDefinition.h>

Public Variables

double biteSeconds
QString biteSound
QString bobber
QString castSound
QList<QcFishingLoot> loot
double maxDistance
double maxSeconds
double minSeconds
double rainFactor
double speed

Detailed Description

While it floats on water a fish bites after a wait between minSeconds and maxSeconds (times rainFactor in rain) for biteSeconds; reeling in then catches one entry of loot. The bobber goes beyond maxDistance from the player. The loot table is part of the rod, so another rod (or a pack) can fish other things. Only that the item fishes reaches the client, which sends the use as QcMsg::ThrowItem.

Member Variable Documentation

double QcFishingDefinition::biteSeconds

Seconds a fish stays on the hook ("biteSeconds", 0.05 to 60).

QString QcFishingDefinition::biteSound

Sound key played when a fish bites ("biteSound"); empty for none.

QString QcFishingDefinition::bobber

The projectile kind it casts ("bobber", required).

QString QcFishingDefinition::castSound

Sound key played when it casts ("castSound"); empty for none.

QList<QcFishingLoot> QcFishingDefinition::loot

What reeling in a bite catches, one entry drawn by weight ("loot", 1 to 64 entries).

double QcFishingDefinition::maxDistance

Distance from the player in metres beyond which the bobber goes ("maxDistance", 1 to 128).

double QcFishingDefinition::maxSeconds

Longest wait for a bite, in seconds ("maxSeconds", minSeconds to 3600).

double QcFishingDefinition::minSeconds

Shortest wait for a bite, in seconds ("minSeconds", 0.05 to 3600).

double QcFishingDefinition::rainFactor

Factor on the wait in rain ("rainFactor", 0.01 to 10).

double QcFishingDefinition::speed

Cast speed in m/s ("speed", 1 to QcProjectileDefinition::maxSpeed).