About: Source:NetHack 1.3d/worn.c   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

Below is the full text to worn.c from the source code of NetHack 1.3d. To link to a particular line, write [[NetHack 1.3d/worn.c#line123]], for example. Warning! This is the source code from an old release. For the latest release, see Source code

AttributesValues
rdfs:label
  • Source:NetHack 1.3d/worn.c
rdfs:comment
  • Below is the full text to worn.c from the source code of NetHack 1.3d. To link to a particular line, write [[NetHack 1.3d/worn.c#line123]], for example. Warning! This is the source code from an old release. For the latest release, see Source code
dcterms:subject
dbkwik:nethack/pro...iPageUsesTemplate
abstract
  • Below is the full text to worn.c from the source code of NetHack 1.3d. To link to a particular line, write [[NetHack 1.3d/worn.c#line123]], for example. Warning! This is the source code from an old release. For the latest release, see Source code 1. /* SCCS Id: @(#)worn.c 1.3 87/07/14 2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3. /* worn.c - version 1.0.2 */ 4. 5. #include "hack.h" 6. 7. struct worn { 8. long w_mask; 9. struct obj **w_obj; 10. } worn[] = { 11. { W_ARM, &uarm }, 12. { W_ARM2, &uarm2 }, 13. { W_ARMH, &uarmh }, 14. { W_ARMS, &uarms }, 15. { W_ARMG, &uarmg }, 16. { W_RINGL, &uleft }, 17. { W_RINGR, &uright }, 18. { W_WEP, &uwep }, 19. { W_BALL, &uball }, 20. { W_CHAIN, &uchain }, 21. { 0, 0 } 22. }; 23. 24. setworn(obj, mask) 25. register struct obj *obj; 26. long mask; 27. { 28. register struct worn *wp; 29. register struct obj *oobj; 30. 31. for(wp = worn; wp->w_mask; wp++) if(wp->w_mask & mask) { 32. oobj = *(wp->w_obj); 33. if(oobj && !(oobj->owornmask & wp->w_mask)) 34. impossible("Setworn: mask = %ld.", wp->w_mask); 35. if(oobj) oobj->owornmask &= ~wp->w_mask; 36. if(obj && oobj && wp->w_mask == W_ARM){ 37. if(uarm2) { 38. impossible("Setworn: uarm2 set?"); 39. } else 40. setworn(uarm, W_ARM2); 41. } 42. *(wp->w_obj) = obj; 43. if(obj) obj->owornmask |= wp->w_mask; 44. } 45. if(uarm2 && !uarm) { 46. uarm = uarm2; 47. uarm2 = 0; 48. uarm->owornmask ^= (W_ARM | W_ARM2); 49. } 50. } 51. 52. /* called e.g. when obj is destroyed */ 53. setnotworn(obj) register struct obj *obj; { 54. register struct worn *wp; 55. 56. for(wp = worn; wp->w_mask; wp++) 57. if(obj == *(wp->w_obj)) { 58. *(wp->w_obj) = 0; 59. obj->owornmask &= ~wp->w_mask; 60. } 61. if(uarm2 && !uarm) { 62. uarm = uarm2; 63. uarm2 = 0; 64. uarm->owornmask ^= (W_ARM | W_ARM2); 65. } 66. }
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software