Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sniper scope improvements, binoculars #6588

Merged
merged 3 commits into from
Oct 4, 2014
Merged

Conversation

RavingManiac
Copy link
Contributor

Sniper rifle zoom now adds a client.pixel_x/y offset in addition to zoom. Currently 11 tiles in the direction the user is facing, keeping the user in the field of view, one tile away from the edge. Zooming can now be done through the right-click menu.

Binoculars added. Functionally similar to sniper scope. Adminspawn-only for now.

…oom. Currently 11 tiles in the direction the user is facing. Zooming can now be done through the right-click menu.

Binoculars added. Functionally similar to sniper scope. Adminspawn-only as of this commit.
@@ -1306,6 +1306,10 @@
var/obj/item/weapon/gun/energy/sniperrifle/s = locate() in src
if(s.zoom)
s.zoom()
if(locate(/obj/item/device/binoculars, contents))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this actually work? Reference does not list locate(type,container), so it might be actually trying to locate a turf with coordinates (type, contents, null) using locate(X,Y,Z) signature, as only one that has more than 1 arguments.
Usually locate is used as in example two lines above - locate(type) in container
Also pretty sure you don't need to explicitly use 'contents', as that is implied 'in [atom]' is used

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using 'locate(bar) in foo.contents' seems to be more reliable than just using 'in foo'. Pretty sure locate(foo,bar) will just return you a value of foo anywhere in the world and ignore bar.

@mwerezak
Copy link
Contributor

mwerezak commented Oct 4, 2014

If zooming is the same for binoculars and sniper scopes it would be nice if you could generalize the action of zooming into a proc and then reuse that in both items.

comma added a commit that referenced this pull request Oct 4, 2014
Sniper scope improvements, binoculars
@comma comma merged commit 41ce4fc into Baystation12:dev Oct 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants