moved portal detection to state hunt
This commit is contained in:
parent
9498f0333b
commit
8d5ce2ae98
1 changed files with 17 additions and 17 deletions
34
bore.af
34
bore.af
|
|
@ -45,23 +45,6 @@ STATE: {combat} ~~ {
|
|||
DO: SetState {ring_fail}
|
||||
IF: NoMobsInDist 5
|
||||
DO: SetState {hunt}
|
||||
IF: All
|
||||
Expr {setvar[portal, wobjectfindnearestbyobjectclass[14]]}
|
||||
Expr {coordinatedistancewithz[getplayercoordinates[], wobjectgetphysicscoordinates[getvar[portal]]] <= 8}
|
||||
Not Expr {wobjectgetname[wobjectfindnearestbyobjectclass[14]]==Singularity Caul}
|
||||
Not Expr {wobjectgetname[wobjectfindnearestbyobjectclass[14]]#Destroyed.*}
|
||||
Expr {wobjectisvalid[getvar[portal]]}
|
||||
Expr {setvar[portalHeading, getheadingto[getvar[portal]]]}
|
||||
Expr {setvar[playerHeading, getheading[wobjectgetplayer[]]]}
|
||||
Expr {setvar[relativeAngle, abs[getvar[portalHeading] - getvar[playerHeading]]]}
|
||||
Expr {setvar[relativeAngle, iif[getvar[relativeAngle] > 180, 360 - getvar[relativeAngle], getvar[relativeAngle]]]}
|
||||
Expr {setvar[turnDirection, iif[randint[0,2] == 0, -90, 90]]}
|
||||
Expr {getvar[relativeAngle] <= 11.25}
|
||||
Expr {setvar[newHeading, abs[getvar[playerHeading] + getvar[turnDirection]]]}
|
||||
DO: DoAll
|
||||
Chat {/vt opt set enablenav false}
|
||||
Chat {/vt opt set enablecombat false}
|
||||
SetState {avoid_portal}
|
||||
IF: All
|
||||
ChatCapture {^(?<name>['A-Za-z ]+) (?<text>has discovered the .*!)$} {}
|
||||
Expr {$capturegroup_name==getcharstringprop[1]}
|
||||
|
|
@ -112,6 +95,23 @@ STATE: {hunt} ~~ {
|
|||
Chat {/vt opt set lootonlyrarecorpses false}
|
||||
Chat {/vt opt set lootpriorityboost false}
|
||||
SetState {loot}
|
||||
IF: All
|
||||
Expr {setvar[portal, wobjectfindnearestbyobjectclass[14]]}
|
||||
Expr {coordinatedistancewithz[getplayercoordinates[], wobjectgetphysicscoordinates[getvar[portal]]] <= 8}
|
||||
Not Expr {wobjectgetname[wobjectfindnearestbyobjectclass[14]]==Singularity Caul}
|
||||
Not Expr {wobjectgetname[wobjectfindnearestbyobjectclass[14]]#Destroyed.*}
|
||||
Expr {wobjectisvalid[getvar[portal]]}
|
||||
Expr {setvar[portalHeading, getheadingto[getvar[portal]]]}
|
||||
Expr {setvar[playerHeading, getheading[wobjectgetplayer[]]]}
|
||||
Expr {setvar[relativeAngle, abs[getvar[portalHeading] - getvar[playerHeading]]]}
|
||||
Expr {setvar[relativeAngle, iif[getvar[relativeAngle] > 180, 360 - getvar[relativeAngle], getvar[relativeAngle]]]}
|
||||
Expr {setvar[turnDirection, iif[randint[0,2] == 0, -90, 90]]}
|
||||
Expr {getvar[relativeAngle] <= 11.25}
|
||||
Expr {setvar[newHeading, abs[getvar[playerHeading] + getvar[turnDirection]]]}
|
||||
DO: DoAll
|
||||
Chat {/vt opt set enablenav false}
|
||||
Chat {/vt opt set enablecombat false}
|
||||
SetState {avoid_portal}
|
||||
|
||||
~~ }
|
||||
STATE: {Default} ~~ {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue